aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2017-01-01 19:10:18 +0100
committerBryn M. Reeves <bmr@redhat.com>2017-02-20 16:55:40 +0000
commit3f791204833783b838c35d73f74070f6c4e145a7 (patch)
treef5ff3fa14cf90f7c163dcd78cab6cb6702ca7875
parent795ef7309af7d49f3f547b231a997730ed6ef626 (diff)
downloadsos-3f791204833783b838c35d73f74070f6c4e145a7.tar.gz
[sosreport][regression] --tmp-dir on NFS raises uncaught exception
logging has to be shut down after the final archive is created, since archive class prints logs during the archive creation. Resolves: #909 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/sosreport.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index dd3a60c7..4f83a1ec 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -882,9 +882,7 @@ class SoSReport(object):
ui_console.setLevel(logging.INFO)
self.ui_log.addHandler(ui_console)
- def _finish_logging(self):
- logging.shutdown()
-
+ def _add_sos_logs(self):
# Make sure the log files are added before we remove the log
# handlers. This prevents "No handlers could be found.." messages
# from leaking to the console when running in --quiet mode when
@@ -1479,7 +1477,7 @@ class SoSReport(object):
# files are closed and cleaned up at exit.
#
# All subsequent terminal output must use print().
- self._finish_logging()
+ self._add_sos_logs()
archive = None # archive path
directory = None # report directory path (--build)
@@ -1562,6 +1560,7 @@ class SoSReport(object):
self.policy.display_results(archive, directory, checksum)
# clean up
+ logging.shutdown()
if self.tempfile_util:
self.tempfile_util.clean()
if self.tmpdir: