[mac_prise] search by uid
This commit is contained in:
parent
11325cc284
commit
23a0a30678
1 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ conn = psycopg2.connect(user='crans', database='mac_prises')
|
||||||
conn.set_session(autocommit = True)
|
conn.set_session(autocommit = True)
|
||||||
cur = conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
cur = conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
|
||||||
|
|
||||||
membres_actifs = ldap.search('(|(droits=Cableur)(droits=Nounou)(droits=Apprenti)(droits=Bureau))')
|
membres_actifs = ldap.search(u'(|(droits=Cableur)(droits=Nounou)(droits=Apprenti)(droits=Bureau))')
|
||||||
chambres_ma = []
|
chambres_ma = []
|
||||||
for membre_actif in membres_actifs:
|
for membre_actif in membres_actifs:
|
||||||
try:
|
try:
|
||||||
|
@ -34,7 +34,7 @@ for membre_actif in membres_actifs:
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
clubs = ldap.search('cid=*')
|
clubs = ldap.search(u'cid=*')
|
||||||
chambres_clubs = []
|
chambres_clubs = []
|
||||||
for club in clubs:
|
for club in clubs:
|
||||||
try:
|
try:
|
||||||
|
@ -73,7 +73,7 @@ def genere_comptage(duree):
|
||||||
fetched = cur.fetchall()
|
fetched = cur.fetchall()
|
||||||
|
|
||||||
for entry in fetched:
|
for entry in fetched:
|
||||||
machines = ldap.search('(macAddress=%s)' % entry['mac'])
|
machines = ldap.search(u'(macAddress=%s)' % entry['mac'])
|
||||||
if len(machines) > 0:
|
if len(machines) > 0:
|
||||||
if isinstance(machines[0], lc_ldap.objets.machineWifi):
|
if isinstance(machines[0], lc_ldap.objets.machineWifi):
|
||||||
continue
|
continue
|
||||||
|
@ -176,7 +176,7 @@ def reperage_mac_inconnue():
|
||||||
|
|
||||||
for mac in liste_parsee[chambre].keys():
|
for mac in liste_parsee[chambre].keys():
|
||||||
try:
|
try:
|
||||||
proprio_associe = ldap.search('macAddress=%s' % mac)[0].proprio()
|
proprio_associe = ldap.search(u'macAddress=%s' % mac)[0].proprio()
|
||||||
if str(proprio_associe['chbre'][0]).lower() == chambre.lower():
|
if str(proprio_associe['chbre'][0]).lower() == chambre.lower():
|
||||||
garbage = liste_parsee[chambre].pop(mac)
|
garbage = liste_parsee[chambre].pop(mac)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue