dhcpd: drope les macs "<automatique>"
This commit is contained in:
parent
47ee3eed1c
commit
4ce302b699
1 changed files with 6 additions and 1 deletions
|
@ -36,6 +36,8 @@ class dydhcp:
|
|||
@raises OmapiError:
|
||||
@raises socket.error:
|
||||
"""
|
||||
if '<automatique>' 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 '<automatique>' 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() != '<automatique>' and AddrInNet(machine.ip(), net) :
|
||||
if '<automatique>' 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() }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue