Blame SOURCES/0038-sosreport-do-not-make-logging-calls-after-OSError.patch

0cd6dc
From ed44939d5988098feb3f3ddededd68a0a4b9a9df Mon Sep 17 00:00:00 2001
0cd6dc
From: "Bryn M. Reeves" <bmr@redhat.com>
0cd6dc
Date: Tue, 13 Jan 2015 17:26:33 +0000
0cd6dc
Subject: [PATCH 38/93] [sosreport] do not make logging calls after OSError
0cd6dc
0cd6dc
Following an OSError during archive setup the logging subsystem
0cd6dc
is potentially in an inconsistent or unusable state (e.g. due to
0cd6dc
a readonly file system error).
0cd6dc
0cd6dc
Use the print function directly since we just need to report the
0cd6dc
error and exit.
0cd6dc
0cd6dc
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
0cd6dc
---
0cd6dc
 sos/sosreport.py | 9 ++++++---
0cd6dc
 1 file changed, 6 insertions(+), 3 deletions(-)
0cd6dc
0cd6dc
diff --git a/sos/sosreport.py b/sos/sosreport.py
0cd6dc
index 2a16555..3c0397c 100644
0cd6dc
--- a/sos/sosreport.py
0cd6dc
+++ b/sos/sosreport.py
0cd6dc
@@ -1091,10 +1091,13 @@ class SoSReport(object):
0cd6dc
             self._make_archive_paths()
0cd6dc
             return
0cd6dc
         except (OSError, IOError) as e:
0cd6dc
+            # we must not use the logging subsystem here as it is potentially
0cd6dc
+            # in an inconsistent or unreliable state (e.g. an EROFS for the
0cd6dc
+            # file system containing our temporary log files).
0cd6dc
             if e.errno in fatal_fs_errors:
0cd6dc
-                self.ui_log.error("")
0cd6dc
-                self.ui_log.error(" %s while setting up archive" % e.strerror)
0cd6dc
-                self.ui_log.error("")
0cd6dc
+                print("")
0cd6dc
+                print(" %s while setting up archive" % e.strerror)
0cd6dc
+                print("")
0cd6dc
             else:
0cd6dc
                 raise e
0cd6dc
         except Exception as e:
0cd6dc
-- 
0cd6dc
1.9.3
0cd6dc