diff options
author | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-04-22 14:49:44 +0000 |
---|---|---|
committer | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-04-22 14:49:44 +0000 |
commit | 0005940c1ef4275c5fdb4e6e40d4d378fd52ff6c (patch) | |
tree | 327990addfd2a5dedfff0d1e02db087d4e71e726 | |
parent | 90d2ef6fa91d6e5f634864645efcb7c89f0c7437 (diff) | |
download | sos-0005940c1ef4275c5fdb4e6e40d4d378fd52ff6c.tar.gz |
updated man page to describe debug option and added new switch
during plugin exception attempt to print to stdout the issue and also to a log file
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@932 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rw-r--r-- | man/en/sosreport.1 | 24 | ||||
-rwxr-xr-x | sos/sosreport.py | 22 |
2 files changed, 33 insertions, 13 deletions
diff --git a/man/en/sosreport.1 b/man/en/sosreport.1 index e5344d74..ea4a5f04 100644 --- a/man/en/sosreport.1 +++ b/man/en/sosreport.1 @@ -7,13 +7,13 @@ sosreport \- Generate debugging information for this system [-n|--skip-plugins plugin-names]\fR [-e|--enable-plugins plugin-names]\fR [-o|--only-plugins plugin-names]\fR - [-a|--alloptions] [-v|--verbose] - [--diagnose] [--analyze] [--report] - [--config-file conf] [--batch] - [--build] [--name name] [--no-colors] - [--ticket-number number] [--debug] - [--upload] [--tmp-dir directory] - [--profile] + [-a|--alloptions] [-v|--verbose]\fR + [--diagnose] [--analyze] [--report]\fR + [--config-file conf] [--batch]\fR + [--build] [--name name] [--no-colors]\fR + [--ticket-number number] [--debug]\fR + [--upload] [--tmp-dir directory]\fR + [--dst-dir directory] [--profile] [--help]\fR .SH DESCRIPTION \fBsosreport\fR generates a compressed tarball of debugging information for the system it is run on that can be sent to technical support @@ -59,9 +59,12 @@ Enable html/xml report writing .B \--config-file CONFIG Specify alternate configuration file .TP -.B \--tmp-dir +.B \--tmp-dir DIRECTORY Specify alternate temporary directory to copy data .TP +.B \--dst-dir DIRECTORY +Specify alternate directory to store compressed report +.TP .B \--batch Perform data gathering unattended .TP @@ -78,10 +81,13 @@ Do not archive copied data, leave directory tree untouched for further modificat Disable colors written to console .TP .B \--debug -Run in trace mode for exceptions +Give opportunity to debug python exceptions through the python debugger. .TP .B \--profile Turn on profiling for cmds run +.TP +.B \--help +Display sosreport help system. .SH MAINTAINER .nf Adam Stokes <astokes@fedoraproject.org> diff --git a/sos/sosreport.py b/sos/sosreport.py index a11c5160..6b236e3b 100755 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -84,7 +84,7 @@ def doException(etype, eval, etrace): if hasattr(sys, 'ps1') or not sys.stderr.isatty(): # we are in interactive mode or we don't have a tty-like # device, so we call the default hook - sys.__excepthook__(etype, value, traceback) + sys.__excepthook__(etype, eval, etrace) else: import traceback, pdb # we are NOT in interactive mode, print the exception... @@ -173,7 +173,7 @@ def parse_options(opts): help="increase verbosity") __cmdParser__.add_option("--debug", action="count", \ dest="debug", \ - help="enabling debugging") + help="enabling debugging through python debugger") __cmdParser__.add_option("--ticket-number", action="store", \ dest="ticketNumber", \ help="set ticket number") @@ -186,6 +186,9 @@ def parse_options(opts): __cmdParser__.add_option("--tmp-dir", action="store", \ dest="tmp_dir", \ help="specify alternate temporary directory", default="/tmp") + __cmdParser__.add_option("--dst-dir", action="store", \ + dest="dst_dir", \ + help="specify alternate directory to store compressed report", default="/tmp") __cmdParser__.add_option("--diagnose", action="store_true", \ dest="diagnose", \ help="enable diagnostics", default=False) @@ -194,7 +197,7 @@ def parse_options(opts): help="enable analyzations", default=False) __cmdParser__.add_option("--report", action="store_true", \ dest="report", \ - help="disable html/xml reporting", default=False) + help="Enable html/xml reporting", default=False) __cmdParser__.add_option("--profile", action="store_true", \ dest="profiler", \ help="turn on profiling", default=False) @@ -365,7 +368,7 @@ def sosreport(opts): if GlobalVars.__cmdLineOpts__.profiler: proflog = logging.getLogger('sosprofile') proflog.setLevel(logging.DEBUG) - + # if stdin is not a tty, disable colors and don't ask questions if not sys.stdin.isatty(): GlobalVars.__cmdLineOpts__.nocolors = True @@ -690,6 +693,11 @@ No changes will be made to your system. except: if GlobalVars.__raisePlugins__: raise + else: + error_log = open(logdir + "/sosreport-plugin-errors.txt", "a") + traceback.print_exception(etype, eval, etrace, limit=2, file=sys.stdout) + error_log.write(traceback.format_exc) + error_log.close() print _(" Running plugins. Please wait ...") print @@ -707,6 +715,12 @@ No changes will be made to your system. except: if GlobalVars.__raisePlugins__: raise + else: + error_log = open(logdir + "/sosreport-plugin-errors.txt", "a") + traceback.print_exception(etype, eval, etrace, limit=2, file=sys.stdout) + error_log.write(traceback.format_exc) + error_log.close() + print if GlobalVars.__cmdLineOpts__.report: |