From bfcc044db22f1be48f180c25283b6858999e1642 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 15 Nov 2007 10:27:59 -0500 Subject: If unable to connect to the XML-RPC server print a more useful error msg. --- ipa-admintools/ipa-addgroup | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ipa-admintools/ipa-addgroup') diff --git a/ipa-admintools/ipa-addgroup b/ipa-admintools/ipa-addgroup index 97dfd5f7..15d42a91 100644 --- a/ipa-admintools/ipa-addgroup +++ b/ipa-admintools/ipa-addgroup @@ -30,6 +30,7 @@ import ipa.ipaerror import xmlrpclib import kerberos import ldap +import errno def usage(): print "ipa-addgroup [-d|--description STRING] group" @@ -95,8 +96,11 @@ def main(): client = ipaclient.IPAClient() client.add_group(group) print cn + " successfully added" - except xmlrpclib.Fault, f: - print f.faultString + 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]) -- cgit