cloudutils: service is-active output check for "failed" (#3574)

Small change to check for the right output of the system call.

Fixes: #3572
This commit is contained in:
dahn 2019-09-10 18:33:42 +02:00 committed by Rohit Yadav
parent d43b499429
commit 2496e53bbb

View File

@ -217,7 +217,8 @@ class serviceOpsRedhat7(serviceOps):
def isServiceRunning(self, servicename): def isServiceRunning(self, servicename):
try: try:
o = bash("systemctl is-active " + servicename) o = bash("systemctl is-active " + servicename)
return "inactive" not in o.getStdout() textout = o.getStdout()
return "inactive" not in textout and "failed" not in textout
except: except:
return False return False