From cd0b9655db363a0e036811ae77ad79b4bd33905e Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Mon, 2 May 2016 12:29:03 -0400 Subject: [PATCH] make sysv and initctl non-exclusive --- awx/plugins/library/scan_services.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/awx/plugins/library/scan_services.py b/awx/plugins/library/scan_services.py index 7214c57012..f417a3fdfa 100644 --- a/awx/plugins/library/scan_services.py +++ b/awx/plugins/library/scan_services.py @@ -59,8 +59,8 @@ class ServiceScanService(BaseService): initctl_path = self.module.get_bin_path("initctl") chkconfig_path = self.module.get_bin_path("chkconfig") - # Upstart and sysvinit - if initctl_path is not None and chkconfig_path is None: + # sysvinit + if service_path is not None and chkconfig_path is None: rc, stdout, stderr = self.module.run_command("%s --status-all 2>&1 | grep -E \"\\[ (\\+|\\-) \\]\"" % service_path, use_unsafe_shell=True) for line in stdout.split("\n"): line_data = line.split() @@ -72,6 +72,9 @@ class ServiceScanService(BaseService): else: service_state = "stopped" services.append({"name": service_name, "state": service_state, "source": "sysv"}) + + # Upstart + if initctl_path is not None and chkconfig_path is None: p = re.compile('^\s?(?P.*)\s(?P\w+)\/(?P\w+)(\,\sprocess\s(?P[0-9]+))?\s*$') rc, stdout, stderr = self.module.run_command("%s list" % initctl_path) real_stdout = stdout.replace("\r","")