summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Hostbase/ldapauth.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-06-15 14:49:52 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-06-15 14:49:52 -0500
commit644d34552c4e2bc6a1da1daef5e3ac734b06b205 (patch)
tree789bb8f0ce96091698af4ba928a7b0b02db9218c /src/lib/Server/Hostbase/ldapauth.py
parent7be5239be45d6ee52d0b80d2a5993d3bdb6b933b (diff)
downloadbcfg2-644d34552c4e2bc6a1da1daef5e3ac734b06b205.tar.gz
bcfg2-644d34552c4e2bc6a1da1daef5e3ac734b06b205.tar.bz2
bcfg2-644d34552c4e2bc6a1da1daef5e3ac734b06b205.zip
Hostbase: More PY3K fixes
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Server/Hostbase/ldapauth.py')
-rw-r--r--src/lib/Server/Hostbase/ldapauth.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/Server/Hostbase/ldapauth.py b/src/lib/Server/Hostbase/ldapauth.py
index 21b462c86..f3db26f67 100644
--- a/src/lib/Server/Hostbase/ldapauth.py
+++ b/src/lib/Server/Hostbase/ldapauth.py
@@ -69,7 +69,8 @@ class ldapauth(object):
None)
result_type, result_data = conn.result(result_id, 0)
return ('success', 'User profile found', result_data,)
- except ldap.LDAPError, e:
+ except ldap.LDAPError:
+ e = sys.exc_info()[1]
#connection failed
return ('error', 'LDAP connect failed', e,)
@@ -86,7 +87,8 @@ class ldapauth(object):
None)
result_type, result_data = conn.result(result_id, 0)
return ('success', 'User profile found', result_data,)
- except ldap.LDAPError, e:
+ except ldap.LDAPError:
+ e = sys.exc_info()[1]
#connection failed
return ('error', 'LDAP connect failed', e,)
@@ -108,7 +110,8 @@ class ldapauth(object):
raw_obj = result_data[0][1]
distinguishedName = raw_obj['distinguishedName']
return ('success', distinguishedName[0],)
- except ldap.LDAPError, e:
+ except ldap.LDAPError:
+ e = sys.exc_info()[1]
#connection failed
return ('error', 'LDAP connect failed', e,)
@@ -134,7 +137,8 @@ class ldapauth(object):
self.is_superuser = False
return
- except KeyError, e:
+ except KeyError:
+ e = sys.exc_info()[1]
raise LDAPAUTHError("Portions of the LDAP User profile not present")
def member_of(self):