Handle exceptions more gracefully on systems with python-ldap 2.2.0

442136
This commit is contained in:
Rob Crittenden 2008-04-14 18:04:25 -04:00
parent ce3f79e51c
commit ff3ca61f73

View File

@ -178,11 +178,14 @@ class IPADiscovery:
except LDAPError, err:
#no good
try:
if type(err.message) == dict:
for (k, v) in err.message.iteritems():
logging.error("LDAP Error: %s" % v )
else:
logging.error("LDAP Error: "+err.message)
except AttributeError:
logging.error("LDAP Error: "+str(err))
return []