mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Fix old python support in scan_services
Python 2.4/RHEL5 doesn't support in-line conditionals so this breaks it out into a normal multi-line condition
This commit is contained in:
parent
84c2e71907
commit
c442f4923b
@ -66,7 +66,10 @@ class ServiceScanService(BaseService):
|
||||
if len(line_data) < 4:
|
||||
continue # Skipping because we expected more data
|
||||
service_name = " ".join(line_data[3:])
|
||||
service_state = "running" if line_data[1] == "+" else "stopped"
|
||||
if line_data[1] == "+":
|
||||
service_state = "running"
|
||||
else:
|
||||
service_state = "stopped"
|
||||
services.append({"name": service_name, "state": service_state, "source": "sysv"})
|
||||
rc, stdout, stderr = self.module.run_command("%s list" % initctl_path)
|
||||
real_stdout = stdout.replace("\r","")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user