From a7601e551d9ec5f098357e958ee80d343dcfb322 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 16 Apr 2014 21:49:28 +0100 Subject: Handle fatal file system errors in SoSReport.final_work() Out-of-space and read-only file system errors while creating the compressed archive should be treated as fatal and cause the run to end. Partial fix for Issue #266. Signed-off-by: Bryn M. Reeves --- sos/sosreport.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sos/sosreport.py b/sos/sosreport.py index 9da1ff63..6f62bb47 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -1147,6 +1147,13 @@ class SoSReport(object): # compression could fail for a number of reasons try: final_filename = self.archive.finalize(self.opts.compression_type) + except OSError as e: + if e.errno in fatal_fs_errors: + self.ui_log.error("") + self.ui_log.error(" %s while finalizing archive" + % e.strerror) + self.ui_log.error(" %s" % e.filename) + self._exit(1) except: if self.opts.debug: raise -- cgit