My ldap application relies on user input for a ldap server uri, so I am looking for a way to use the ldap api to determine whether the ldap server is up or not.
All the docs have to say is this:
initialize(uri)
Opens a new connection with an LDAP server, and return an LDAP object (see 1.1.4) used to perform operations on that server. Parameter uri has to be a valid LDAP URL.
Expand|Select|Wrap|Line Numbers
- server = "ldap://666.222.111.333"
- try:
- l = ldap.initialize(server)
- except ldap.LDAPError, errorMsg:
- print errorMsg
Is initialize actually trying to make a connection?
If so, how can I find out if the connection failed without doing a bind?
I'm running python 2.4.2 on SUSE Linux Enterprise Desktop v. 10.