Compatibilité 2.8
This commit is contained in:
parent
0bf05dbad3
commit
48feb825b8
1 changed files with 6 additions and 5 deletions
11
main.py
11
main.py
|
@ -29,11 +29,12 @@ def regen_dhcp(api_client):
|
||||||
host_mac_ip = {}
|
host_mac_ip = {}
|
||||||
|
|
||||||
for hmi in api_client.list("dhcp/hostmacip/"):
|
for hmi in api_client.list("dhcp/hostmacip/"):
|
||||||
if hmi['extension'] not in host_mac_ip.keys():
|
if 'ipv4' in hmi:
|
||||||
host_mac_ip[hmi['extension']] = []
|
if hmi['extension'] not in host_mac_ip.keys():
|
||||||
host_mac_ip[hmi['extension']].append((hmi['hostname'],
|
host_mac_ip[hmi['extension']] = []
|
||||||
hmi['mac_address'],
|
host_mac_ip[hmi['extension']].append((hmi['hostname'],
|
||||||
hmi['ipv4']))
|
hmi['mac_address'],
|
||||||
|
hmi['ipv4']))
|
||||||
|
|
||||||
template = ("host {hostname}{extension} {{\n"
|
template = ("host {hostname}{extension} {{\n"
|
||||||
" hardware ethernet {mac_address};\n"
|
" hardware ethernet {mac_address};\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue