aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-04-16 19:54:13 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-04-16 20:12:57 +0100
commitc719653e4d68a0910f66922753d539fbfc874853 (patch)
tree446f15109475505af19adb8f95d2338d5aaa0ea4
parent1f36f8753f5b18e76647e84b8a5c0ad10cba7f15 (diff)
downloadsos-c719653e4d68a0910f66922753d539fbfc874853.tar.gz
Log an error and exit with non-zero status if archive setup fails
Currently unexpected exceptions during archive setup log a python backtrace and exit with success. Exit with failure (1) when this happens and log a message indicating the exception is unhandled before printing the backtrace. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/sosreport.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 31ef0fa8..c3b2f421 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -910,9 +910,10 @@ class SoSReport(object):
self._make_archive_paths()
except Exception as e:
import traceback
+ self.ui_log.error(" Unexpected exception setting up archive:")
traceback.print_exc(e)
- self.ui_log.info(e)
- self._exit(0)
+ self.ui_log.error(e)
+ self._exit(1)
def setup(self):
self.ui_log.info(_(" Setting up plugins ..."))