Compatibilité 2.8

This commit is contained in:
Yoann Pietri 2020-01-22 21:50:41 +01:00 committed by root
parent 0bf05dbad3
commit 48feb825b8

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"