From fc35a37e4c2c99c12b268c67d44ac6f44ef9d881 Mon Sep 17 00:00:00 2001 From: Megh Bhatt Date: Fri, 3 Feb 2017 15:50:59 -0800 Subject: [PATCH] Fix verify_database on centos7 and redhat On centos7 and redhat, contrail-database is still a SYSV service and hence its status needs to be checked by looking at the return code of service contrail-database status rather than the output since the output does not contain the word running. Pipe-ing head -n 10 changes the return code to always return 0. The above was broken due to commit for bug #1638670 commit f378fac60aa4372bc50c8f96eefef1a5df0c5d3b which made setup_all work on xenial. Revert the change to verify_service made in that commit. Change-Id: If38f781713145d28f8725634685f8f98661bc056 Closes-Bug: #1657934 --- fabfile/tasks/verify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabfile/tasks/verify.py b/fabfile/tasks/verify.py index b71e3ff57..78ef1a5be 100644 --- a/fabfile/tasks/verify.py +++ b/fabfile/tasks/verify.py @@ -13,7 +13,7 @@ class OpenStackSetupError(Exception): def verify_service(service, initd_service=False): for x in xrange(10): with settings(warn_only=True): - output = sudo("service %s status | head -10" % service) + output = sudo("service %s status" % service) if initd_service: if output.succeeded or re.search('Active:.*active', output): return