From c719653e4d68a0910f66922753d539fbfc874853 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 16 Apr 2014 19:54:13 +0100 Subject: 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 --- sos/sosreport.py | 5 +++-- 1 file 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 ...")) -- cgit