Blame SOURCES/sos-bz1825283-env-host-in-container.patch

a02485
From d9dd8ad790b6799491e4891ae19bb85124ab6794 Mon Sep 17 00:00:00 2001
a02485
From: Robert Thomas Manes <robb.manes@gmail.com>
a02485
Date: Fri, 17 Apr 2020 10:29:47 -0400
a02485
Subject: [PATCH] [redhat] fix RH containers without sysroot Attempting to run
a02485
 sosreport in a container currently will always traceback unless
a02485
 ENV_HOST_SYSROOT is set to '/'.
a02485
a02485
Allow default NoneType sysroot to function as well.
a02485
a02485
Resolves: #2028
a02485
a02485
Signed off by: Robb Manes <rmanes@redhat.com>
a02485
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
a02485
---
a02485
 sos/policies/redhat.py | 2 +-
a02485
 1 file changed, 1 insertion(+), 1 deletion(-)
a02485
a02485
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
a02485
index ba9bacf4..16cb23ec 100644
a02485
--- a/sos/policies/redhat.py
a02485
+++ b/sos/policies/redhat.py
a02485
@@ -144,7 +144,7 @@ class RedHatPolicy(LinuxPolicy):
a02485
                 self._in_container = True
a02485
         if ENV_HOST_SYSROOT in os.environ:
a02485
             self._host_sysroot = os.environ[ENV_HOST_SYSROOT]
a02485
-        use_sysroot = self._in_container and self._host_sysroot != '/'
a02485
+        use_sysroot = self._in_container and self._host_sysroot is not None
a02485
         if use_sysroot:
a02485
             host_tmp_dir = os.path.abspath(self._host_sysroot + self._tmp_dir)
a02485
             self._tmp_dir = host_tmp_dir
a02485
-- 
a02485
2.21.3
a02485