diff --git a/gestion/gen_confs/dhcpd_new.py b/gestion/gen_confs/dhcpd_new.py index 9c24f367..b86b1479 100644 --- a/gestion/gen_confs/dhcpd_new.py +++ b/gestion/gen_confs/dhcpd_new.py @@ -36,6 +36,8 @@ class dydhcp: @raises OmapiError: @raises socket.error: """ + if '' in [ip, mac]: + return msg = OmapiMessage.open(b"host") msg.message.append((b"create", struct.pack("!I", 1))) msg.message.append((b"exclusive", struct.pack("!I", 1))) @@ -56,6 +58,8 @@ class dydhcp: @raises OmapiError: @raises socket.error: """ + if '' in [ip, mac]: + return msg = OmapiMessage.open(b"host") msg.obj.append((b"hardware-address", pack_mac(mac))) msg.obj.append((b"hardware-type", struct.pack("!I", 1))) @@ -147,7 +151,8 @@ class dhcp(gen_config) : for machine in self.machines : self.anim.cycle() for net in self.reseaux.keys() : - if machine.ip() != '' and AddrInNet(machine.ip(), net) : + if '' not in [machine.ip(), machine.mac()] and \ + AddrInNet(machine.ip(), net): host_template = self.host_template # variable pour remplir le template #d = { 'nom' : machine.nom().split('.')[0] , 'mac' : machine.mac() , 'ip' : machine.ip() }