|
|
0cd6dc |
From 370f58d3e9ec141ab4b0c49521c79cc90fab6c00 Mon Sep 17 00:00:00 2001
|
|
|
0cd6dc |
From: "Bryn M. Reeves" <bmr@redhat.com>
|
|
|
0cd6dc |
Date: Mon, 19 Jan 2015 20:49:47 +0000
|
|
|
0cd6dc |
Subject: [PATCH 45/93] [sosreport] fix silent exception handling in sosreport
|
|
|
0cd6dc |
|
|
|
0cd6dc |
The OSError and IOError exception branches for the setup, collect,
|
|
|
0cd6dc |
and postproc methods silently ignore plugin exceptions that are
|
|
|
0cd6dc |
not on the list of fatal fs errors (that will cause sos to halt
|
|
|
0cd6dc |
immediately).
|
|
|
0cd6dc |
|
|
|
0cd6dc |
Fix this and either raise the exception (if --debug is given) or
|
|
|
0cd6dc |
log it to a file via _log_plugin_exception().
|
|
|
0cd6dc |
|
|
|
0cd6dc |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
0cd6dc |
---
|
|
|
0cd6dc |
sos/sosreport.py | 18 ++++++++++++------
|
|
|
0cd6dc |
1 file changed, 12 insertions(+), 6 deletions(-)
|
|
|
0cd6dc |
|
|
|
0cd6dc |
diff --git a/sos/sosreport.py b/sos/sosreport.py
|
|
|
0cd6dc |
index 83ea30d..e83e718 100644
|
|
|
0cd6dc |
--- a/sos/sosreport.py
|
|
|
0cd6dc |
+++ b/sos/sosreport.py
|
|
|
0cd6dc |
@@ -1131,11 +1131,13 @@ class SoSReport(object):
|
|
|
0cd6dc |
% e.strerror)
|
|
|
0cd6dc |
self.ui_log.error("")
|
|
|
0cd6dc |
self._exit(1)
|
|
|
0cd6dc |
+ if self.raise_plugins:
|
|
|
0cd6dc |
+ raise
|
|
|
0cd6dc |
+ self._log_plugin_exception(plugname, "setup")
|
|
|
0cd6dc |
except:
|
|
|
0cd6dc |
if self.raise_plugins:
|
|
|
0cd6dc |
raise
|
|
|
0cd6dc |
- else:
|
|
|
0cd6dc |
- self._log_plugin_exception(plugname, "setup")
|
|
|
0cd6dc |
+ self._log_plugin_exception(plugname, "setup")
|
|
|
0cd6dc |
|
|
|
0cd6dc |
def version(self):
|
|
|
0cd6dc |
"""Fetch version information from all plugins and store in the report
|
|
|
0cd6dc |
@@ -1177,11 +1179,13 @@ class SoSReport(object):
|
|
|
0cd6dc |
% e.strerror)
|
|
|
0cd6dc |
self.ui_log.error("")
|
|
|
0cd6dc |
self._exit(1)
|
|
|
0cd6dc |
+ if self.raise_plugins:
|
|
|
0cd6dc |
+ raise
|
|
|
0cd6dc |
+ self._log_plugin_exception(plugname, "collect")
|
|
|
0cd6dc |
except:
|
|
|
0cd6dc |
if self.raise_plugins:
|
|
|
0cd6dc |
raise
|
|
|
0cd6dc |
- else:
|
|
|
0cd6dc |
- self._log_plugin_exception(plugname, "collect")
|
|
|
0cd6dc |
+ self._log_plugin_exception(plugname, "collect")
|
|
|
0cd6dc |
self.ui_log.info("")
|
|
|
0cd6dc |
|
|
|
0cd6dc |
def report(self):
|
|
|
0cd6dc |
@@ -1324,11 +1328,13 @@ class SoSReport(object):
|
|
|
0cd6dc |
% e.strerror)
|
|
|
0cd6dc |
self.ui_log.error("")
|
|
|
0cd6dc |
self._exit(1)
|
|
|
0cd6dc |
+ if self.raise_plugins:
|
|
|
0cd6dc |
+ raise
|
|
|
0cd6dc |
+ self._log_plugin_exception(plugname, "postproc")
|
|
|
0cd6dc |
except:
|
|
|
0cd6dc |
if self.raise_plugins:
|
|
|
0cd6dc |
raise
|
|
|
0cd6dc |
- else:
|
|
|
0cd6dc |
- self._log_plugin_exception(plugname, "postproc")
|
|
|
0cd6dc |
+ self._log_plugin_exception(plugname, "postproc")
|
|
|
0cd6dc |
|
|
|
0cd6dc |
def final_work(self):
|
|
|
0cd6dc |
# this must come before archive creation to ensure that log
|
|
|
0cd6dc |
--
|
|
|
0cd6dc |
1.9.3
|
|
|
0cd6dc |
|