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

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