aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-12-06 12:57:34 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-12-06 12:57:34 +0000
commit30b42e422a5700f5d85499be1c79fee86d804469 (patch)
treec777af75ab3135bd472ff0c9ededa143c462a727
parentd32e37cf6fcb1a78fd48821b8838e63d7fb7c7d0 (diff)
downloadsos-30b42e422a5700f5d85499be1c79fee86d804469.tar.gz
Fix exception in postgresql postproc method
Do not assume that tmp_dir has been set and wrap tree deletion in a try block.
-rw-r--r--sos/plugins/postgresql.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py
index 66a20613..62fdcbec 100644
--- a/sos/plugins/postgresql.py
+++ b/sos/plugins/postgresql.py
@@ -57,4 +57,9 @@ class postgresql(Plugin, RedHatPlugin):
def postproc(self):
import shutil
- shutil.rmtree(self.tmp_dir)
+ if self.tmp_dir == None:
+ return
+ try:
+ shutil.rmtree(self.tmp_dir)
+ except:
+ pass