From b4194cd48b67cfc39ba234219581e49582fc9675 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Wed, 28 Aug 2019 09:32:24 +0200 Subject: [PATCH] `service is-active` output check for "failed" --- python/lib/cloudutils/utilities.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/lib/cloudutils/utilities.py b/python/lib/cloudutils/utilities.py index 6fbc5829003c..2a7043dfa18a 100755 --- a/python/lib/cloudutils/utilities.py +++ b/python/lib/cloudutils/utilities.py @@ -217,7 +217,8 @@ class serviceOpsRedhat7(serviceOps): def isServiceRunning(self, servicename): try: 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: return False