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-addgroup | |
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-addgroup')
-rw-r--r-- | ipa-admintools/ipa-addgroup | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/ipa-admintools/ipa-addgroup b/ipa-admintools/ipa-addgroup index 58190c02d..6bf35f6f4 100644 --- a/ipa-admintools/ipa-addgroup +++ b/ipa-admintools/ipa-addgroup @@ -17,9 +17,32 @@ # 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.group + import ipa.ipaclient as ipaclient + import ipa.ipavalidate as ipavalidate + import ipa.ipautil as ipautil + import ipa.config + import ipa.ipaerror + + import xmlrpclib + import kerberos + import ldap + import errno +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-addgroup [-d|--description STRING] [-g|--gid GID] group" + print "ipa-addgroup [-d|--description STRING] [-g|--gid GID] [-v|--verbose] group" sys.exit(1) def parse_options(): @@ -28,6 +51,8 @@ def parse_options(): help="A description of this group") parser.add_option("-g", "--gid", dest="gid", help="The gid to use for this group. If not included one is automatically set.") + parser.add_option("-v", "--verbose", action="store_true", dest="verbose", + help="Verbose output of the XML-RPC connection") parser.add_option("--usage", action="store_true", help="Program usage") @@ -88,21 +113,6 @@ def main(): return 0 try: - import sys - from optparse import OptionParser - import ipa - import ipa.group - import ipa.ipaclient as ipaclient - import ipa.ipavalidate as ipavalidate - import ipa.ipautil as ipautil - import ipa.config - import ipa.ipaerror - - import xmlrpclib - import kerberos - import ldap - import errno - if __name__ == "__main__": sys.exit(main()) except SystemExit, e: |