Merge branch 'compa_2.8' into 'master'

Compatibilité 2.8

See merge request re2o/dhcp!2
This commit is contained in:
chirac 2020-01-22 21:54:33 +01:00
commit 9baece2c7b

11
main.py
View file

@ -29,11 +29,12 @@ def regen_dhcp(api_client):
host_mac_ip = {}
for hmi in api_client.list("dhcp/hostmacip/"):
if hmi['extension'] not in host_mac_ip.keys():
host_mac_ip[hmi['extension']] = []
host_mac_ip[hmi['extension']].append((hmi['hostname'],
hmi['mac_address'],
hmi['ipv4']))
if 'ipv4' in hmi:
if hmi['extension'] not in host_mac_ip.keys():
host_mac_ip[hmi['extension']] = []
host_mac_ip[hmi['extension']].append((hmi['hostname'],
hmi['mac_address'],
hmi['ipv4']))
template = ("host {hostname}{extension} {{\n"
" hardware ethernet {mac_address};\n"