diff options
author | Robert Thomas Manes <robb.manes@gmail.com> | 2020-04-17 10:29:47 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-04-30 11:17:33 -0400 |
commit | d9dd8ad790b6799491e4891ae19bb85124ab6794 (patch) | |
tree | 2ee0e7b88732e23b6797669f9426c43a9c870ef6 | |
parent | ab443738f139cbee114aa96dd8d3b89089c7f927 (diff) | |
download | sos-d9dd8ad790b6799491e4891ae19bb85124ab6794.tar.gz |
[redhat] fix RH containers without sysroot
Attempting to run sosreport in a container currently will always
traceback unless ENV_HOST_SYSROOT is set to '/'.
Allow default NoneType sysroot to function as well.
Resolves: #2028
Signed off by: Robb Manes <rmanes@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/policies/redhat.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py index ba9bacf4..16cb23ec 100644 --- a/sos/policies/redhat.py +++ b/sos/policies/redhat.py @@ -144,7 +144,7 @@ class RedHatPolicy(LinuxPolicy): self._in_container = True if ENV_HOST_SYSROOT in os.environ: self._host_sysroot = os.environ[ENV_HOST_SYSROOT] - use_sysroot = self._in_container and self._host_sysroot != '/' + use_sysroot = self._in_container and self._host_sysroot is not None if use_sysroot: host_tmp_dir = os.path.abspath(self._host_sysroot + self._tmp_dir) self._tmp_dir = host_tmp_dir |