Readme à jour, et quelques modifications sur les noms de variables.

This commit is contained in:
Pierre-Elliott Bécue 2015-03-10 21:06:16 +01:00
parent f228493399
commit 4bc4cb7abe
8 changed files with 152 additions and 102 deletions

View file

@ -17,14 +17,14 @@ from gestion.trigger.host import record_parser, chaining
@record_parser(lc_ldap.attributs.macAddress.ldap_name, lc_ldap.attributs.ipHostNumber.ldap_name)
@chaining(1)
def dhcp(ob_id, body, diff):
"""Computes mac_ip data to send from body and diff
def dhcp(ob_id, operations, diff, more):
"""Computes mac_ip data to send from operations and diff
The dict contains lists of tuples, so we can iterate on them
in the service."""
macs = tuple([body[i].get(lc_ldap.attributs.macAddress.ldap_name, [''])[0] for i in xrange(0, 2)])
ips = tuple([body[i].get(lc_ldap.attributs.ipHostNumber.ldap_name, [''])[0] for i in xrange(0, 2)])
hostnames = tuple([body[i].get(lc_ldap.attributs.host.ldap_name, [''])[0] for i in xrange(0, 2)])
macs = tuple([operations[i].get(lc_ldap.attributs.macAddress.ldap_name, [''])[0] for i in xrange(0, 2)])
ips = tuple([operations[i].get(lc_ldap.attributs.ipHostNumber.ldap_name, [''])[0] for i in xrange(0, 2)])
hostnames = tuple([operations[i].get(lc_ldap.attributs.host.ldap_name, [''])[0] for i in xrange(0, 2)])
# Régénération du DHCP :
if not macs[0]: