switchs2: une mac = plusieurs machines
This commit is contained in:
parent
4992818761
commit
b1da0c15e4
1 changed files with 3 additions and 1 deletions
|
@ -354,12 +354,14 @@ def check_conf_ldap(hostname):
|
|||
if th_prises_set and pr_prise not in th_prises_set:
|
||||
print(" Aucune machine de chbre. Candidats: %r" % th_prises_set)
|
||||
else:
|
||||
machines = []
|
||||
for mac in set(port.seen_macs):
|
||||
res = ldap.search(u'macAddress=%s' % mac)
|
||||
if not res:
|
||||
print(" Unknown mac %s" % mac)
|
||||
continue
|
||||
machine = res[0]
|
||||
machines += res
|
||||
for machine in machines:
|
||||
owner = machine.proprio()
|
||||
if isinstance(owner, ldap_classes.AssociationCrans):
|
||||
the = unicode(machine.get('prise', ['N/A'])[0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue