diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2012-12-06 12:57:34 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2012-12-06 12:57:34 +0000 |
commit | 30b42e422a5700f5d85499be1c79fee86d804469 (patch) | |
tree | c777af75ab3135bd472ff0c9ededa143c462a727 | |
parent | d32e37cf6fcb1a78fd48821b8838e63d7fb7c7d0 (diff) | |
download | sos-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.py | 7 |
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 |