diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2015-01-19 20:49:47 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2015-01-19 20:49:47 +0000 |
commit | 370f58d3e9ec141ab4b0c49521c79cc90fab6c00 (patch) | |
tree | a34e96fd2dc75b8add5a9df56a5586ffc3365eae | |
parent | 263e4183822c70b37019879308e77c91272e2895 (diff) | |
download | sos-370f58d3e9ec141ab4b0c49521c79cc90fab6c00.tar.gz |
[sosreport] fix silent exception handling in sosreport
The OSError and IOError exception branches for the setup, collect,
and postproc methods silently ignore plugin exceptions that are
not on the list of fatal fs errors (that will cause sos to halt
immediately).
Fix this and either raise the exception (if --debug is given) or
log it to a file via _log_plugin_exception().
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/sosreport.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py index 83ea30d8..e83e7180 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -1131,11 +1131,13 @@ class SoSReport(object): % e.strerror) self.ui_log.error("") self._exit(1) + if self.raise_plugins: + raise + self._log_plugin_exception(plugname, "setup") except: if self.raise_plugins: raise - else: - self._log_plugin_exception(plugname, "setup") + self._log_plugin_exception(plugname, "setup") def version(self): """Fetch version information from all plugins and store in the report @@ -1177,11 +1179,13 @@ class SoSReport(object): % e.strerror) self.ui_log.error("") self._exit(1) + if self.raise_plugins: + raise + self._log_plugin_exception(plugname, "collect") except: if self.raise_plugins: raise - else: - self._log_plugin_exception(plugname, "collect") + self._log_plugin_exception(plugname, "collect") self.ui_log.info("") def report(self): @@ -1324,11 +1328,13 @@ class SoSReport(object): % e.strerror) self.ui_log.error("") self._exit(1) + if self.raise_plugins: + raise + self._log_plugin_exception(plugname, "postproc") except: if self.raise_plugins: raise - else: - self._log_plugin_exception(plugname, "postproc") + self._log_plugin_exception(plugname, "postproc") def final_work(self): # this must come before archive creation to ensure that log |