diff options
author | Adam Stokes <ajs@redhat.com> | 2010-07-29 09:05:00 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2010-07-29 09:05:00 +0100 |
commit | f107d6b5730ebd7bba3e2f5a108a9d3d9aeb38b5 (patch) | |
tree | 4a5f74653808b24cfde6d8ac3d9a712e282b4c20 | |
parent | 7cdbcd60973f8fd4e091d3aedb24200d782db22d (diff) | |
download | sos-f107d6b5730ebd7bba3e2f5a108a9d3d9aeb38b5.tar.gz |
Fix plugin exception handling and log unhandled exceptions to a file
Resolves: bz584253
-rwxr-xr-x | sos/sosreport.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py index 5492748a..a5685b9e 100755 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -655,8 +655,9 @@ No changes will be made to your system. raise else: error_log = open(logdir + "/sosreport-plugin-errors.txt", "a") + etype, eval, etrace = sys.exc_info() traceback.print_exception(etype, eval, etrace, limit=2, file=sys.stdout) - error_log.write(traceback.format_exc) + error_log.write(traceback.format_exc()) error_log.close() tmpcount += len(plug.diagnose_msgs) @@ -727,8 +728,9 @@ No changes will be made to your system. raise else: error_log = open(logdir + "/sosreport-plugin-errors.txt", "a") + etype, eval, etrace = sys.exc_info() traceback.print_exception(etype, eval, etrace, limit=2, file=sys.stdout) - error_log.write(traceback.format_exc) + error_log.write(traceback.format_exc()) error_log.close() print |