[trigger] Bugfix pour que le tout marche bien ensemble.

This commit is contained in:
Pierre-Elliott Bécue 2014-06-15 00:54:03 +02:00
parent f41ab72706
commit 4e90bd023b
3 changed files with 17 additions and 15 deletions

View file

@ -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: