Handle ldap.UNWILLING_TO_PERFORM more gracefully

This commit is contained in:
Rob Crittenden 2007-11-09 16:34:52 -05:00
parent f7358533d0
commit 99b84bfd01
2 changed files with 9 additions and 1 deletions

View File

@ -152,3 +152,8 @@ CONNECTION_GSSAPI_CREDENTIALS = gen_error_code(
CONNECTION_CATEGORY,
0x0003,
"GSSAPI Authorization error")
CONNECTION_UNWILLING = gen_error_code(
CONNECTION_CATEGORY,
0x0004,
"Account inactivated. Server is unwilling to perform.")

View File

@ -77,7 +77,10 @@ class IPAConnPool:
conn = ipaserver.ipaldap.IPAdmin(host,port,None,None,None,debug)
# This will bind the connection
conn.set_krbccache(krbccache, cprinc.name)
try:
conn.set_krbccache(krbccache, cprinc.name)
except ldap.UNWILLING_TO_PERFORM, e:
raise ipaerror.gen_exception(ipaerror.CONNECTION_UNWILLING)
return conn