Example #1
0
 def clean(self):
     raw_iface = networkutils.get_interfaces()[0]
     if self.address == raw_iface.addr:
         return
     returncode, stdout = networkutils.ping(self.address, packets=1)
     if not returncode:
         raise ValidationError(u'Erro, existe outra máquina com o mesmo IP na rede.')
Example #2
0
 def clean(self):
     raw_iface = networkutils.get_interfaces()[0]
     if self.address == raw_iface.addr:
         return
     returncode, stdout = networkutils.ping(self.address, packets=1)
     if not returncode:
         raise ValidationError(u'Erro, existe outra máquina com o mesmo IP na rede.')
Example #3
0
 def __init__(self, *args, **kwargs):
     super(NetworkInterface, self).__init__(*args, **kwargs)
     if not self.id:
         raw_iface = networkutils.get_interfaces()[0]
         self.address = raw_iface.addr
         self.netmask = raw_iface.netmask
         self.gateway = self.default_gateway
         self.dns1 = self.default_gateway
Example #4
0
 def __init__(self, *args, **kwargs):
     super(NetworkInterface, self).__init__(*args, **kwargs)
     if not self.id:
         raw_iface = networkutils.get_interfaces()[0]
         self.address = raw_iface.addr
         self.netmask = raw_iface.netmask
         self.gateway = self.default_gateway
         self.dns1 = self.default_gateway
Example #5
0
def get_raw_network_interface_address():
    raw_iface = networkutils.get_interfaces()[0]
    return raw_iface.addr
Example #6
0
def get_raw_network_interface_address():
    raw_iface = networkutils.get_interfaces()[0]
    return raw_iface.addr