diff options
author | navid <navid@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-08-17 13:42:51 +0000 |
---|---|---|
committer | navid <navid@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-08-17 13:42:51 +0000 |
commit | 8092e9862adb06e6cec8f02e0dfe3d8a50030949 (patch) | |
tree | a764e897e8e571914346f29e8e2123647505cacc /src/sosreport | |
parent | b451a9da5eedbacd9216409cf8e21b19a0d848c6 (diff) | |
download | sos-8092e9862adb06e6cec8f02e0dfe3d8a50030949.tar.gz |
merged navid-dev -r r350:r364 into trunk/rhel-5-startr1.7-8
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@368 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'src/sosreport')
-rwxr-xr-x | src/sosreport | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/sosreport b/src/sosreport index 76fc8206..daf43116 100755 --- a/src/sosreport +++ b/src/sosreport @@ -84,9 +84,6 @@ signal.signal(signal.SIGTERM, exittermhandler) ## FIXME: Need to figure out how to IPC with child threads in case of ## multiple SIGTERMs. -# for debugging -__raisePlugins__ = 0 - class OptionParser_extended(OptionParser): def print_help(self): OptionParser.print_help(self) @@ -133,9 +130,15 @@ __cmdParser__.add_option("-k", action="extend", \ __cmdParser__.add_option("-a", "--alloptions", action="store_true", \ dest="usealloptions", default=False, \ help="enable all options for loaded plugins") +__cmdParser__.add_option("-u", "--upload", action="store_true", \ + dest="upload", default=False, \ + help="upload the report to Red Hat support") __cmdParser__.add_option("-v", "--verbose", action="count", \ dest="verbosity", \ help="increase verbosity") +__cmdParser__.add_option("--debug", action="count", \ + dest="debug", \ + help="enabling debugging") __cmdParser__.add_option("--no-progressbar", action="store_false", \ dest="progressbar", default=True, \ help="do not display a progress bar.") @@ -294,6 +297,13 @@ class XmlReport: outfn.write(self.doc.serialize(None,1)) outfn.close() +# if debugging is enabled, allow plugins to raise exceptions + +if __cmdLineOpts__.debug: + __raisePlugins__ = 1 +else: + __raisePlugins__ = 0 + def sosreport(): # pylint: disable-msg = R0912 # pylint: disable-msg = R0914 @@ -528,7 +538,7 @@ def sosreport(): raw_input(_("""This utility will collect some detailed information about the hardware and setup of your Red Hat Enterprise Linux system. The information is collected and an archive is packaged under -/tmp, which you can send to a support rappresentative. +/tmp, which you can send to a support representative. Red Hat will use this information for diagnostic purposes ONLY and it will be considered confidential information. @@ -537,7 +547,7 @@ No changes will be made to your system. Press ENTER to continue, or CTRL-C to quit. """)) - except KeyboardInterrupt: + except: print sys.exit(0) @@ -723,8 +733,6 @@ Press ENTER to continue, or CTRL-C to quit. rfd.close() - # Collect any needed user information (name, etc) - # Call the postproc method for each plugin for plugname, plug in loadedplugins: try: @@ -737,7 +745,10 @@ Press ENTER to continue, or CTRL-C to quit. policy.packageResults() # delete gathered files os.system("/bin/rm -rf %s" % dstroot) + # automated submission will go here + if __cmdLineOpts__.upload: + policy.uploadResults() # Close all log files and perform any cleanup logging.shutdown() |