[trigger] Bugfix pour que le tout marche bien ensemble.
This commit is contained in:
parent
f41ab72706
commit
4e90bd023b
3 changed files with 17 additions and 15 deletions
|
@ -93,11 +93,11 @@ def dhcp(body={}):
|
|||
|
||||
"""
|
||||
if body and isinstance(body, dict):
|
||||
for (mac, ip, name) in body.get("add", ()):
|
||||
for (mac, ip, name) in body.get("add", []):
|
||||
add_dhcp_host(mac, ip, name)
|
||||
for (mac, ip) in body.get("delete", ()):
|
||||
for (mac, ip) in body.get("delete", []):
|
||||
delete_dhcp_host(mac, ip)
|
||||
for (rmac, rip, mac, ip, name) in body.get("update", ()):
|
||||
for (rmac, rip, mac, ip, name) in body.get("update", []):
|
||||
delete_dhcp_host(rmac, rip)
|
||||
add_dhcp_host(mac, ip, name)
|
||||
elif body == True:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue