Better LDAP error handling in ipa-client-install

This commit is contained in:
Rob Crittenden 2009-11-30 15:48:31 -05:00 committed by Jason Gerard DeRose
parent 384eec771d
commit 060662f320

View File

@ -177,15 +177,11 @@ class IPADiscovery:
return []
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))
if not isinstance(err, ldap.TIMEOUT):
logging.error("LDAP Error: %s: %s" %
(err.args[0]['desc'], err.args[0].get('info', '')))
else:
logging.error("LDAP Error: timeout")
return []