diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2018-08-31 12:50:24 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2018-08-31 12:50:24 +0100 |
commit | 2e07f7c4778145d4366476ecc4383d491458b541 (patch) | |
tree | 3f4f9c9889bcfa18875290d089a02fcab255054d | |
parent | d5b1d349b868e66a4001c23dae7afa05daaca907 (diff) | |
download | sos-2e07f7c4778145d4366476ecc4383d491458b541.tar.gz |
[sosreport] properly raise exceptions when --debug is given
OSError and IOError exceptions were not raised to the terminal
when --debug is in effect since they were silently caught in the
generic exception handler.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/sosreport.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py index 00c3e811..80633966 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -995,7 +995,8 @@ class SoSReport(object): print(" %s while setting up archive" % e.strerror) print("") else: - raise e + print("Error setting up archive: %s" % e) + raise except Exception as e: self.ui_log.error("") self.ui_log.error(" Unexpected exception setting up archive:") @@ -1467,6 +1468,8 @@ class SoSReport(object): return self.final_work() except (OSError): + if self.opts.debug: + raise self._cleanup() except (KeyboardInterrupt): self.ui_log.error("\nExiting on user cancel") |