another odd problem... with ldap restart
Anil Jangity
anilj at entic.net
Tue Mar 20 17:06:43 CET 2007
If I restart the LDAP server, while connected to it using python-ldap,
it doesn't seem to be throwing an exception at the right time.
self.logger('*** about to do a search ***')
result = g.ldap[customer][uid].search(base=suffix, scope="base", attr=["dn"])
self.logger('*** finished search ***')
g.ldap is a wrapper method that just does this:
try:
self.logger('1')
ldap_result_id = self.l.search(ldap_url.dn, ldap_url.scope,
ldap_url.filterstr, ldap_url.attrs)
self.logger('2')
except ldap.LDAPError, e:
self.logger("LDAP SEARCH failed: %s" % (e))
return False
Once connected to the ldap server, I do stop-start ldap server. Then,
I do two searches in order. The 2nd search throws an exception "Can't
contact LDAP server". I am just wondering why it doesn't do it the
first time?
Mar 20 09:43:35 DEBUG 127.0.0.1 *** about to do a search ***
Mar 20 09:43:35 INFO LDAP SEARCH: dn: uid=demo, ou=People, o=entic.net
scope: 0 filter: (objectClass=top)
Mar 20 09:43:35 INFO 1
Mar 20 09:43:35 INFO 2
Mar 20 09:43:36 DEBUG 127.0.0.1 *** about to do a search ***
Mar 20 09:43:36 INFO LDAP SEARCH: dn: uid=demo, ou=People, o=entic.net
scope: 0 filter: (objectClass=top)
Mar 20 09:43:36 INFO 1
Mar 20 09:43:36 INFO LDAP SEARCH failed: {'info': '', 'desc': "Can't
contact LDAP server"}
Mar 20 09:43:36 DEBUG 127.0.0.1 *** finished search ***
More information about the python-ldap
mailing list