Parfois, des gens exemptent des machines sans IP ou MAC...
This commit is contained in:
parent
9507536d3e
commit
9e934c2e8c
1 changed files with 4 additions and 0 deletions
|
@ -45,9 +45,13 @@ class exemptions(gen_config):
|
||||||
for machine in machines:
|
for machine in machines:
|
||||||
for destination in machine["exempt"]:
|
for destination in machine["exempt"]:
|
||||||
if destination.value.version == 4:
|
if destination.value.version == 4:
|
||||||
|
if not machine['ipHostNumber']:
|
||||||
|
continue
|
||||||
source = str(machine["ipHostNumber"][0])
|
source = str(machine["ipHostNumber"][0])
|
||||||
requete = "INSERT INTO exemptes (ip_crans, ip_dest) VALUES ('%s','%s')" % (source, destination)
|
requete = "INSERT INTO exemptes (ip_crans, ip_dest) VALUES ('%s','%s')" % (source, destination)
|
||||||
else:
|
else:
|
||||||
|
if not machine['macAddress']:
|
||||||
|
continue
|
||||||
source = str(machine["macAddress"][0])
|
source = str(machine["macAddress"][0])
|
||||||
requete = "INSERT INTO exemptes6 (mac_crans, ip_dest) VALUES ('%s','%s')" % (source, destination)
|
requete = "INSERT INTO exemptes6 (mac_crans, ip_dest) VALUES ('%s','%s')" % (source, destination)
|
||||||
# Si ip vide, passons au suivant
|
# Si ip vide, passons au suivant
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue