summaryrefslogtreecommitdiffstats
path: root/ipa-admintools
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-05-13 10:59:37 -0400
committerRob Crittenden <rcritten@redhat.com>2008-05-13 12:00:21 -0400
commit3daa94ccc05d8d85de4309ee4e56a76bc435efc9 (patch)
tree78337f68588fd3d8aa2b7d2871e79312c13d004e /ipa-admintools
parentb1cc4199fa152957aaabed1b22e8b828d054d9c6 (diff)
downloadfreeipa-3daa94ccc05d8d85de4309ee4e56a76bc435efc9.tar.gz
freeipa-3daa94ccc05d8d85de4309ee4e56a76bc435efc9.tar.xz
freeipa-3daa94ccc05d8d85de4309ee4e56a76bc435efc9.zip
Catch name resolution errors coming from the socket module.
442650
Diffstat (limited to 'ipa-admintools')
-rw-r--r--ipa-admintools/ipa-adddelegation4
-rw-r--r--ipa-admintools/ipa-addgroup4
-rw-r--r--ipa-admintools/ipa-addservice4
-rw-r--r--ipa-admintools/ipa-adduser4
-rw-r--r--ipa-admintools/ipa-deldelegation4
-rw-r--r--ipa-admintools/ipa-delgroup4
-rw-r--r--ipa-admintools/ipa-delservice4
-rw-r--r--ipa-admintools/ipa-deluser4
-rw-r--r--ipa-admintools/ipa-findgroup4
-rw-r--r--ipa-admintools/ipa-findservice4
-rw-r--r--ipa-admintools/ipa-finduser4
-rw-r--r--ipa-admintools/ipa-listdelegation4
-rw-r--r--ipa-admintools/ipa-lockuser4
-rw-r--r--ipa-admintools/ipa-moddelegation4
-rw-r--r--ipa-admintools/ipa-modgroup4
-rw-r--r--ipa-admintools/ipa-moduser4
-rw-r--r--ipa-admintools/ipa-passwd4
-rw-r--r--ipa-admintools/ipa-pwpolicy4
18 files changed, 72 insertions, 0 deletions
diff --git a/ipa-admintools/ipa-adddelegation b/ipa-admintools/ipa-adddelegation
index a7748cc9e..112a0d3a0 100644
--- a/ipa-admintools/ipa-adddelegation
+++ b/ipa-admintools/ipa-adddelegation
@@ -33,6 +33,7 @@ try:
import krbV
import ldap
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -198,6 +199,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-addgroup b/ipa-admintools/ipa-addgroup
index 6bf35f6f4..4f55224db 100644
--- a/ipa-admintools/ipa-addgroup
+++ b/ipa-admintools/ipa-addgroup
@@ -32,6 +32,7 @@ try:
import kerberos
import ldap
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -134,6 +135,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-addservice b/ipa-admintools/ipa-addservice
index 67ec8343a..535fddf67 100644
--- a/ipa-admintools/ipa-addservice
+++ b/ipa-admintools/ipa-addservice
@@ -35,6 +35,7 @@ try:
import ldap
import getpass
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -101,6 +102,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-adduser b/ipa-admintools/ipa-adduser
index be0912e95..caff5a953 100644
--- a/ipa-admintools/ipa-adduser
+++ b/ipa-admintools/ipa-adduser
@@ -33,6 +33,7 @@ try:
import ldap
import getpass
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -268,6 +269,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-deldelegation b/ipa-admintools/ipa-deldelegation
index 1eeb51720..624aefc03 100644
--- a/ipa-admintools/ipa-deldelegation
+++ b/ipa-admintools/ipa-deldelegation
@@ -28,6 +28,7 @@ try:
import kerberos
import copy
import errno
+ import socket
import ipa.aci
from ipa import ipaerror
@@ -140,6 +141,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-delgroup b/ipa-admintools/ipa-delgroup
index cf66ac1aa..629f79ff3 100644
--- a/ipa-admintools/ipa-delgroup
+++ b/ipa-admintools/ipa-delgroup
@@ -25,6 +25,7 @@ try:
import ipa.config
import ipa.ipautil as ipautil
import errno
+ import socket
import xmlrpclib
import kerberos
@@ -102,6 +103,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-delservice b/ipa-admintools/ipa-delservice
index d9807629b..7397c757d 100644
--- a/ipa-admintools/ipa-delservice
+++ b/ipa-admintools/ipa-delservice
@@ -30,6 +30,7 @@ try:
import krbV
import ldap
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -106,6 +107,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-deluser b/ipa-admintools/ipa-deluser
index 39bdff91c..8a4b4ad9c 100644
--- a/ipa-admintools/ipa-deluser
+++ b/ipa-admintools/ipa-deluser
@@ -25,6 +25,7 @@ try:
import ipa.ipautil as ipautil
import ipa.config
import errno
+ import socket
import xmlrpclib
import kerberos
@@ -87,6 +88,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-findgroup b/ipa-admintools/ipa-findgroup
index 0c0cf8efd..d884977b8 100644
--- a/ipa-admintools/ipa-findgroup
+++ b/ipa-admintools/ipa-findgroup
@@ -29,6 +29,7 @@ try:
import sys
import xmlrpclib
import kerberos
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -154,6 +155,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-findservice b/ipa-admintools/ipa-findservice
index a5ae2be4d..d427e72b3 100644
--- a/ipa-admintools/ipa-findservice
+++ b/ipa-admintools/ipa-findservice
@@ -29,6 +29,7 @@ try:
import sys
import xmlrpclib
import kerberos
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -102,6 +103,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-finduser b/ipa-admintools/ipa-finduser
index c3b217788..40384a3bd 100644
--- a/ipa-admintools/ipa-finduser
+++ b/ipa-admintools/ipa-finduser
@@ -31,6 +31,7 @@ try:
import sys
import xmlrpclib
import kerberos
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -165,6 +166,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-listdelegation b/ipa-admintools/ipa-listdelegation
index b734ccb7e..73c070ecf 100644
--- a/ipa-admintools/ipa-listdelegation
+++ b/ipa-admintools/ipa-listdelegation
@@ -28,6 +28,7 @@ try:
import xmlrpclib
import kerberos
import errno
+ import socket
import ipa.aci
from ipa import ipaerror
@@ -119,6 +120,9 @@ except xmlrpclib.ProtocolError, e:
except ipaerror.IPAError, e:
print("Delegation list failed: " + str(e))
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-lockuser b/ipa-admintools/ipa-lockuser
index c11f1ea8b..0fea7bed1 100644
--- a/ipa-admintools/ipa-lockuser
+++ b/ipa-admintools/ipa-lockuser
@@ -25,6 +25,7 @@ try:
import ipa.config
import ipa.ipautil as ipautil
import errno
+ import socket
import xmlrpclib
import kerberos
@@ -106,6 +107,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-moddelegation b/ipa-admintools/ipa-moddelegation
index d6b09ffb3..39f6b2210 100644
--- a/ipa-admintools/ipa-moddelegation
+++ b/ipa-admintools/ipa-moddelegation
@@ -33,6 +33,7 @@ try:
import ldap
import copy
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -236,6 +237,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-modgroup b/ipa-admintools/ipa-modgroup
index 6905f5018..11aba4ad0 100644
--- a/ipa-admintools/ipa-modgroup
+++ b/ipa-admintools/ipa-modgroup
@@ -30,6 +30,7 @@ try:
import kerberos
import ldap
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -227,6 +228,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-moduser b/ipa-admintools/ipa-moduser
index a9fd223e1..39b0fab60 100644
--- a/ipa-admintools/ipa-moduser
+++ b/ipa-admintools/ipa-moduser
@@ -31,6 +31,7 @@ try:
import kerberos
import ldap
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -293,6 +294,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-passwd b/ipa-admintools/ipa-passwd
index fc39b7f81..e9d04a6d2 100644
--- a/ipa-admintools/ipa-passwd
+++ b/ipa-admintools/ipa-passwd
@@ -30,6 +30,7 @@ try:
import ldap
import getpass
import errno
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -142,6 +143,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)
diff --git a/ipa-admintools/ipa-pwpolicy b/ipa-admintools/ipa-pwpolicy
index 365444f31..71f824c93 100644
--- a/ipa-admintools/ipa-pwpolicy
+++ b/ipa-admintools/ipa-pwpolicy
@@ -29,6 +29,7 @@ try:
import kerberos
import errno
import validate
+ import socket
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -147,6 +148,9 @@ except xmlrpclib.ProtocolError, e:
except ipa.ipaerror.IPAError, e:
print "%s" % (e.message)
sys.exit(1)
+except socket.error, e:
+ print e[1]
+ print "Re-run with -v flag for more details."
except Exception, e:
print "%s" % str(e)
sys.exit(1)