aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-04-16 21:49:28 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-04-16 21:49:28 +0100
commita7601e551d9ec5f098357e958ee80d343dcfb322 (patch)
tree55f5794107fed42f0b170b1f8b1fab4c9560a21e
parent0acc5da2ec4150bda80250674c91ca0cd8e88450 (diff)
downloadsos-a7601e551d9ec5f098357e958ee80d343dcfb322.tar.gz
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 <bmr@redhat.com>
-rw-r--r--sos/sosreport.py7
1 files changed, 7 insertions, 0 deletions
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