summaryrefslogtreecommitdiffstats
path: root/ipa-client
diff options
context:
space:
mode:
authorRob Crittenden <rcrit@rhel1.greyoak.com>2008-04-14 18:04:25 -0400
committerRob Crittenden <rcrit@rhel1.greyoak.com>2008-04-14 18:23:29 -0400
commitff3ca61f73d8df244dbd4e6b31fcec3cbfc28097 (patch)
tree084720db992661a1391cc7d653a0d553832a551b /ipa-client
parentce3f79e51cc2e8285f604039a0b1020e2d7dbc3f (diff)
downloadfreeipa-ff3ca61f73d8df244dbd4e6b31fcec3cbfc28097.tar.gz
freeipa-ff3ca61f73d8df244dbd4e6b31fcec3cbfc28097.tar.xz
freeipa-ff3ca61f73d8df244dbd4e6b31fcec3cbfc28097.zip
Handle exceptions more gracefully on systems with python-ldap 2.2.0
442136
Diffstat (limited to 'ipa-client')
-rw-r--r--ipa-client/ipaclient/ipadiscovery.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/ipa-client/ipaclient/ipadiscovery.py b/ipa-client/ipaclient/ipadiscovery.py
index b7b69136..2bd15192 100644
--- a/ipa-client/ipaclient/ipadiscovery.py
+++ b/ipa-client/ipaclient/ipadiscovery.py
@@ -178,11 +178,14 @@ class IPADiscovery:
except LDAPError, err:
#no good
- 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)
+ 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 []