switchs2.py: don't crash si chbre inexistante
This commit is contained in:
parent
7c4d8dcbb0
commit
e5f7930bd9
2 changed files with 10 additions and 2 deletions
|
@ -321,7 +321,11 @@ def check_conf_ldap(hostname):
|
|||
continue
|
||||
chbre = unicode(res[0].proprio().get('chbre', ['EXT'])[0])
|
||||
th_prise = chbre[0].lower()
|
||||
th_prise += annuaire.chbre_prises(chbre[0], chbre[1:])
|
||||
try:
|
||||
th_prise += annuaire.chbre_prises(chbre[0], chbre[1:])
|
||||
except annuaire.ChbreNotFound:
|
||||
# La chambre est inconnue -> drop
|
||||
continue
|
||||
th_prises_set.add(th_prise)
|
||||
|
||||
pr_prise = bat.lower() + '%d%02d' % (sw_num, port.num)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue