[trigger] Amélioration de lisibilité dans les logs, et correctif mineur
* Ordre des imports dans le service firewall foireux
This commit is contained in:
parent
ccaf431202
commit
56d73814db
4 changed files with 18 additions and 7 deletions
|
@ -6,6 +6,11 @@
|
|||
#
|
||||
# Author : Pierre-Elliott Bécue <becue@crans.org>
|
||||
# Licence : GPLv3
|
||||
# Date : 14/07/2014
|
||||
#
|
||||
# TODO : Take care of each XXX or TODO think about updating
|
||||
# gestion/config/dhcp when submitting for production, because
|
||||
# of .test files.
|
||||
|
||||
import socket
|
||||
import os
|
||||
|
@ -78,12 +83,18 @@ class Dhcp(BasicService):
|
|||
|
||||
if body and isinstance(body, dict):
|
||||
for (mac, ip, name) in body.get("add", []):
|
||||
cls.add_dhcp_host(mac, ip, name)
|
||||
logger.info("Updating DHCP db by adding %s, %s, %s", mac, ip, name)
|
||||
# XXX - Uncommend this when we need to start prod
|
||||
# cls.add_dhcp_host(mac, ip, name)
|
||||
for (mac, ip) in body.get("delete", []):
|
||||
cls.delete_dhcp_host(mac, ip)
|
||||
logger.info("Updating DHCP db by deleting %s, %s", mac, ip)
|
||||
# XXX - Uncommend this when we need to start prod
|
||||
# cls.delete_dhcp_host(mac, ip)
|
||||
for (rmac, rip, mac, ip, name) in body.get("update", []):
|
||||
cls.delete_dhcp_host(rmac, rip)
|
||||
cls.add_dhcp_host(mac, ip, name)
|
||||
logger.info("Updating DHCP db by modifying %s, %s to %s, %s, %s", rmac, rip, mac, ip, name)
|
||||
# XXX - Uncommend this when we need to start prod
|
||||
# cls.delete_dhcp_host(rmac, rip)
|
||||
# cls.add_dhcp_host(mac, ip, name)
|
||||
elif body == True:
|
||||
hosts = {}
|
||||
host_template = """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue