diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2011-06-22 17:01:40 -0500 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2011-06-22 17:01:40 -0500 |
commit | 4849378a62ab0dbf72f8ce4e6b2073dc73f2337a (patch) | |
tree | 14945dd6045c438f5dbc8e96f023258d31e1adf9 /src/lib/Server/Hostbase/ldapauth.py | |
parent | 8d08d5195fa0b6f503752273183948e5d24f33d6 (diff) | |
parent | 2db056574f5f55c3c802da63abe7e3de10db5d76 (diff) | |
download | bcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.tar.gz bcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.tar.bz2 bcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.zip |
Merge branch 'master' of git.mcs.anl.gov:bcfg2
Diffstat (limited to 'src/lib/Server/Hostbase/ldapauth.py')
-rw-r--r-- | src/lib/Server/Hostbase/ldapauth.py | 12 |
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): |