aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2016-07-13 12:47:06 +0100
committerBryn M. Reeves <bmr@redhat.com>2016-07-13 12:47:06 +0100
commit46da5439bb79f294dca8019293eecf3096e5b999 (patch)
tree5a10fde9beaaaeb802b67c0f467ed7883f063e31
parentff2820775597e6fc47bada2ce57b01f8cfd81af6 (diff)
downloadsos-46da5439bb79f294dca8019293eecf3096e5b999.tar.gz
[atomichost] replace custom logic with Policy.in_container()
Don't reinvent the wheel by inspecting file system paths: rely on the existing policy class in_container() method. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/atomichost.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/sos/plugins/atomichost.py b/sos/plugins/atomichost.py
index ce30ac70..a339557e 100644
--- a/sos/plugins/atomichost.py
+++ b/sos/plugins/atomichost.py
@@ -27,10 +27,7 @@ class AtomicHost(Plugin, RedHatPlugin):
]
def check_enabled(self):
- if not os.path.exists("/host/etc/system-release-cpe"):
- return False
- cpe = open("/host/etc/system-release-cpe", "r").readlines()
- return ':atomic-host' in cpe[0]
+ return self.policy().in_container()
def setup(self):
self.add_copy_spec("/etc/ostree/remotes.d")