chambres_vides: utilisation d'un contexte lc_ldap
This commit is contained in:
parent
fc5a4f0a86
commit
a575c7f07b
1 changed files with 3 additions and 2 deletions
|
@ -81,8 +81,9 @@ for clandestin in bad_boys_e_s:
|
|||
else:
|
||||
for m in machine_liste:
|
||||
try:
|
||||
m2 = conn.search(u'mid=%s' % m['mid'][0],mode='w')[0]
|
||||
m2.delete('Adherent sans chambre valide depuis %d jours' % delai)
|
||||
reason = u'Adhérent sans chambre valide depuis %d jours' % delai
|
||||
with conn.search(u'mid=%s' % m['mid'][0], mode='w')[0] as m2:
|
||||
m2.delete(reason)
|
||||
to_print.append( (clandestin['aid'][0], m['ipHostNumber'][0], m['mid'][0], m['host'][0]) )
|
||||
except Exception as e:
|
||||
to_error.append((clandestin['aid'][0], m['ipHostNumber'][0], m['mid'][0], m['host'][0], e))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue