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

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