Skip to content

Commit

Permalink
On centos71, service status command for cassandra does not return
Browse files Browse the repository at this point in the history
'running' in output after moving cassandra out of supervisord and
hence the verify_database task fails during setup_all.
Add option to instead check whether the command succeeded
or failed to determine whether the service is running or not.
Partial-Bug: #1484297

Change-Id: I0b204142da04fb50d3c106da5701e5d8eb866903
  • Loading branch information
Megh Bhatt committed Sep 17, 2015
1 parent 2e9c6fd commit a037f30
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions fabfile/tasks/verify.py
Expand Up @@ -7,13 +7,19 @@
class OpenStackSetupError(Exception):
pass

def verify_service(service):
def verify_service(service, initd_service=False):
for x in xrange(10):
output = sudo("service %s status" % service)
if 'running' in output.lower():
return
if initd_service:
if output.succeeded:
return
else:
sleep(20)
else:
sleep(20)
if 'running' in output.lower():
return
else:
sleep(20)
raise SystemExit("Service %s not running." % service)

@task
Expand All @@ -22,7 +28,7 @@ def verify_database():
zoo_svc = 'zookeeper'
verify_service(zoo_svc)
verify_service("supervisor-database")
verify_service("contrail-database")
verify_service("contrail-database", initd_service=True)

@task
@roles('webui')
Expand Down

0 comments on commit a037f30

Please sign in to comment.