KeyError while performing 'ldapsearch' operation and processing the result data
lgp171188 at gmail.com
Sun Sep 20 16:02:14 CEST 2009
I have been trying to write a function to search a LDAP directory by
using the python-ldap APIs.
Here is the code I have written:
if (result_data == ):
print "LDAP server down"
What I am trying to do in this piece of code is get the list of the
values of 'uidNumber' attribute. The search operation returns a list
containing a tuple. The tuple contains the DN as one value and a
dictionary with uidNumber and its value. I am trying to extract the
value of the uidNumber. I found that result_data was a dictionary
having a key 'uidNumber', but when I try to print its value, I get a
KeyError. Strangely, when I print result_data.keys(), 'uidNumber' is
More information about the python-ldap