diff options
author | Rob Crittenden <rcritten@redhat.com> | 2011-05-17 15:09:39 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-05-18 09:35:04 +0200 |
commit | 4027b12371051c2e9f53b1b6cd2c4e4fbc333731 (patch) | |
tree | b0ad75c5c107e73e9be5bf7547cf93348d793a43 /ipalib/rpc.py | |
parent | 95b4040f6b4f43b864dce86648f09a1402889af9 (diff) | |
download | freeipa-4027b12371051c2e9f53b1b6cd2c4e4fbc333731.tar.gz freeipa-4027b12371051c2e9f53b1b6cd2c4e4fbc333731.tar.xz freeipa-4027b12371051c2e9f53b1b6cd2c4e4fbc333731.zip |
Test for forwarded Kerberos credentials cache in wsgi code.
We should more gracefully handle if the TGT has not been forwarded
than returning a 500 error.
Also catch and display KerberosErrors from ping() in the client better.
ticket 1101
Diffstat (limited to 'ipalib/rpc.py')
-rw-r--r-- | ipalib/rpc.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py index 051d2c3de..d667df71e 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -346,7 +346,19 @@ class xmlclient(Connectible): return serverproxy try: command = getattr(serverproxy, 'ping') - response = command() + try: + response = command() + except Fault, e: + e = decode_fault(e) + if e.faultCode in self.__errors: + error = self.__errors[e.faultCode] + raise error(message=e.faultString) + else: + raise UnknownError( + code=e.faultCode, + error=e.faultString, + server=server, + ) # We don't care about the response, just that we got one break except KerberosError, krberr: |