diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-04-24 10:25:30 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-04-25 10:35:22 -0400 |
commit | 12ea8efc0b05f361a5871451cb095753c8c6cc16 (patch) | |
tree | 29756a022f9ee691250cc71e2a06165b8938ab8b /ipa-admintools/ipa-deluser | |
parent | 47e6a75cffeeec9e4d0bb9bb73931dd5cdab1a9f (diff) | |
download | freeipa-12ea8efc0b05f361a5871451cb095753c8c6cc16.tar.gz freeipa-12ea8efc0b05f361a5871451cb095753c8c6cc16.tar.xz freeipa-12ea8efc0b05f361a5871451cb095753c8c6cc16.zip |
Add --verbose option so the HTTP headers and XML request/response can be seen.
Also re-do the way modules are imported. I was attemping to have ^C handled
gracefully but the way I did it could mask other problems.
443987
Diffstat (limited to 'ipa-admintools/ipa-deluser')
-rw-r--r-- | ipa-admintools/ipa-deluser | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/ipa-admintools/ipa-deluser b/ipa-admintools/ipa-deluser index 36f113db0..39bdff91c 100644 --- a/ipa-admintools/ipa-deluser +++ b/ipa-admintools/ipa-deluser @@ -17,15 +17,36 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +import sys +try: + from optparse import OptionParser + import ipa + import ipa.ipaclient as ipaclient + import ipa.ipautil as ipautil + import ipa.config + import errno + + import xmlrpclib + import kerberos +except ImportError: + print >> sys.stderr, """\ +There was a problem importing one of the required Python modules. The +error was: + + %s +""" % sys.exc_value + sys.exit(1) def usage(): - print "ipa-deluser user" + print "ipa-deluser [-v|--verbose] user" sys.exit(1) def parse_options(): parser = OptionParser() parser.add_option("--usage", action="store_true", help="Program usage") + parser.add_option("-v", "--verbose", action="store_true", dest="verbose", + help="Verbose output of the XML-RPC connection") args = ipa.config.init_config(sys.argv) options, args = parser.parse_args(args) @@ -45,17 +66,6 @@ def main(): return 0 try: - import sys - from optparse import OptionParser - import ipa - import ipa.ipaclient as ipaclient - import ipa.ipautil as ipautil - import ipa.config - import errno - - import xmlrpclib - import kerberos - if __name__ == "__main__": sys.exit(main()) except SystemExit, e: |