summaryrefslogtreecommitdiffstats
path: root/ipa-admintools/ipa-adduser
diff options
context:
space:
mode:
Diffstat (limited to 'ipa-admintools/ipa-adduser')
-rw-r--r--ipa-admintools/ipa-adduser10
1 files changed, 6 insertions, 4 deletions
diff --git a/ipa-admintools/ipa-adduser b/ipa-admintools/ipa-adduser
index d82de8955..e993bee5e 100644
--- a/ipa-admintools/ipa-adduser
+++ b/ipa-admintools/ipa-adduser
@@ -31,6 +31,7 @@ import kerberos
import krbV
import ldap
import getpass
+import errno
def usage():
print "ipa-adduser [-c|--gecos STRING] [-d|--directory STRING] [-f|--firstname STRING] [-l|--lastname STRING] user"
@@ -204,14 +205,15 @@ def main():
user.setValue('homedirectory', directory)
if shell:
user.setValue('loginshell', shell)
- else:
- user.setValue('loginshell', "/bin/sh")
try:
client = ipaclient.IPAClient()
client.add_user(user)
- 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])