diff options
author | Rob Crittenden <rcritten@redhat.com> | 2007-11-15 10:27:59 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2007-11-15 10:27:59 -0500 |
commit | bfcc044db22f1be48f180c25283b6858999e1642 (patch) | |
tree | 4458afb28719c2d155ae0665590278f218dce27d /ipa-admintools/ipa-listdelegation | |
parent | 4d96b37de1d6ebd173909a839ecf19386932d9a5 (diff) | |
download | freeipa-bfcc044db22f1be48f180c25283b6858999e1642.tar.gz freeipa-bfcc044db22f1be48f180c25283b6858999e1642.tar.xz freeipa-bfcc044db22f1be48f180c25283b6858999e1642.zip |
If unable to connect to the XML-RPC server print a more useful error msg.
Diffstat (limited to 'ipa-admintools/ipa-listdelegation')
-rw-r--r-- | ipa-admintools/ipa-listdelegation | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ipa-admintools/ipa-listdelegation b/ipa-admintools/ipa-listdelegation index 4c059c4a..6999e5f8 100644 --- a/ipa-admintools/ipa-listdelegation +++ b/ipa-admintools/ipa-listdelegation @@ -26,6 +26,7 @@ import ipa.config import operator import xmlrpclib import kerberos +import errno import ipa.aci from ipa import ipaerror @@ -52,12 +53,21 @@ def main(): client = ipaclient.IPAClient() try: aci_entry = client.get_aci_entry(aci_fields) - except ipaerror.IPAError, e: - print("Delegation list failed: " + str(e)) + except xmlrpclib.Fault, fault: + if fault.faultCode == errno.ECONNREFUSED: + print "The IPA XML-RPC service is not responding." + else: + print fault.faultString return 1 except kerberos.GSSError, e: print "Could not initialize GSSAPI: %s/%s" % (e[0][0][0], e[0][1][0]) return 1 + except xmlrpclib.ProtocolError, e: + print "Unable to connect to IPA server: %s" % (e.errmsg) + return 1 + except ipaerror.IPAError, e: + print("Delegation list failed: " + str(e)) + return 1 aci_str_list = aci_entry.getValues('aci') if aci_str_list is None: |