Blame SOURCES/sos-bz1891562-tmp-dir-relative-path.patch

900d18
From c07bdbc94269603d2b910ccafa289512478160aa Mon Sep 17 00:00:00 2001
900d18
From: Jake Hunsaker <jhunsake@redhat.com>
900d18
Date: Mon, 26 Oct 2020 14:11:56 -0400
900d18
Subject: [PATCH] [sos] Fix use of relative paths for --tmp-dir
900d18
900d18
Fixes an issue where the use of relative paths for `--tmp-dir` causes a
900d18
failure in the building of the final archive. Previously, a relative
900d18
path would cause the tarball to be produced in a nested directory under
900d18
the temp directory of the same name, which would in turn cause
900d18
compression and all further operations for the archive to fail.
900d18
900d18
Fix this by converting relative paths in the option to the absolute path
900d18
internally.
900d18
900d18
Resolves: RHBZ#1891562
900d18
900d18
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
900d18
---
900d18
 sos/component.py | 2 +-
900d18
 1 file changed, 1 insertion(+), 1 deletion(-)
900d18
900d18
diff --git a/sos/component.py b/sos/component.py
900d18
index 0aef770c6..b44fdf829 100644
900d18
--- a/sos/component.py
900d18
+++ b/sos/component.py
900d18
@@ -138,7 +138,7 @@ def get_tmpdir_default(self):
900d18
         use a standardized env var to redirect to the host's filesystem instead
900d18
         """
900d18
         if self.opts.tmp_dir:
900d18
-            return self.opts.tmp_dir
900d18
+            return os.path.abspath(self.opts.tmp_dir)
900d18
 
900d18
         tmpdir = '/var/tmp'
900d18