aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2019-10-09 15:17:34 -0400
committerBryn M. Reeves <bmr@redhat.com>2019-10-14 13:59:27 +0100
commitcab407857781c4f6c93cf919d270f592d43914c6 (patch)
tree9592b3fe3101b23caaff7692fc1b5eb2abe9398e
parenta9149fcb9f92204ac57b103fb36c1533b92f4d6d (diff)
downloadsos-cab407857781c4f6c93cf919d270f592d43914c6.tar.gz
[InitSystem] Move load_all_services() out from base __init__()
Moves the call to load_all_services() out from the base __init__() of InitSystem() and into SystemdInit(), as highlighted by LGTM.com analysis. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/policies/__init__.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py
index bd9ea4b1..a19daf22 100644
--- a/sos/policies/__init__.py
+++ b/sos/policies/__init__.py
@@ -65,8 +65,6 @@ class InitSystem(object):
self.list_cmd = "%s %s" % (self.init_cmd, list_cmd) or None
self.query_cmd = "%s %s" % (self.init_cmd, query_cmd) or None
- self.load_all_services()
-
def is_enabled(self, name):
"""Check if given service name is enabled """
if self.services and name in self.services:
@@ -150,6 +148,7 @@ class SystemdInit(InitSystem):
list_cmd='list-unit-files --type=service',
query_cmd='status'
)
+ self.load_all_services()
def parse_query(self, output):
for line in output.splitlines():