aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2018-06-05 08:26:09 +0200
committerBryn M. Reeves <bmr@redhat.com>2018-06-07 15:45:38 +0100
commit703263636b2fa9c6adace90d365f5755d64722b2 (patch)
tree2772616953d3d10b058569fffe29e5445eb110b8
parent7aa42642a8df816a99d6a9cc2a7099a76d294050 (diff)
downloadsos-703263636b2fa9c6adace90d365f5755d64722b2.tar.gz
[sosreport] remove tmpdir only if it exists
Prevents raising exception when the dir has been removed. Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/sosreport.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 890e1385..0ec18c03 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -1611,7 +1611,7 @@ class SoSReport(object):
logging.shutdown()
if self.tempfile_util:
self.tempfile_util.clean()
- if self.tmpdir:
+ if self.tmpdir and os.path.isdir(self.tmpdir):
rmtree(self.tmpdir)
return True