aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2016-01-13 10:57:59 +0000
committerBryn M. Reeves <bmr@redhat.com>2016-01-13 10:57:59 +0000
commita7a2dd8eb1791257f80fd2ae2993b06472690aea (patch)
tree6d2287a3e7240b9e7ae3d6b53ecaec7eef0b8670
parentc864e4f7f9a831cc31f341b299d82e6ac5389d2d (diff)
downloadsos-a7a2dd8eb1791257f80fd2ae2993b06472690aea.tar.gz
[sosreport] report correct final path with --build
Ensure the correct path (in the system temporary directory) is reported when the --build option is used. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/sosreport.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index bc7792a9..f61ea4a4 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -1496,7 +1496,9 @@ class SoSReport(object):
directory = self.archive.get_archive_path()
dir_name = os.path.basename(directory)
try:
- os.rename(directory, os.path.join(self.sys_tmp, dir_name))
+ final_dir = os.path.join(self.sys_tmp, dir_name)
+ os.rename(directory, final_dir)
+ directory = final_dir
except (OSError, IOError):
print(_("Error moving directory: %s" % directory))
return False