aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsos/policyredhat.py2
-rwxr-xr-xsos/sosreport.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/sos/policyredhat.py b/sos/policyredhat.py
index 345e0616..6cda8556 100755
--- a/sos/policyredhat.py
+++ b/sos/policyredhat.py
@@ -191,7 +191,7 @@ class SosPolicy:
and reports.
"""
uniqname = "%s-%s" % (self.hostName(), time.strftime("%Y%m%d%H%M%s"))
- dstroot = os.path.join(dir,uniqname)
+ dstroot = os.path.join(tmpdir,uniqname)
try:
os.mkdir(dstroot, 0700)
except:
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 3e0599fc..9a841de5 100755
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -76,7 +76,13 @@ def doExitCode():
def doExit(error=0):
""" Exit with return """
- GlobalVars.policy.cleanDstroot()
+ # We will attempt to clean dstroot; there is only
+ # one instance where the policy is not set and that is
+ # during the actual creation of dstroot
+ try:
+ GlobalVars.policy.cleanDstroot()
+ except AttributeError:
+ sys.exit(error)
sys.exit(error)
def doException(etype, eval, etrace):