From 9561d210e1051a2c357984bee2b219c73835f94e Mon Sep 17 00:00:00 2001 From: Alexander Alber Date: Tue, 14 Jun 2016 11:38:07 -0400 Subject: [PATCH] Check that elasticsearch isn't already started before attempting to start it again --- rollastic/cluster.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rollastic/cluster.py b/rollastic/cluster.py index e5a25d7..3801a73 100644 --- a/rollastic/cluster.py +++ b/rollastic/cluster.py @@ -281,12 +281,11 @@ def restart(self, node): raise Exception("Highstate failed on node=%s%s%s", node.name, LINESEP, jsondumps(val, indent=2)) + ''' Start (if not started during highstate) ''' + if not nso.service_status('elasticsearch', True): + assert nso.service_start('elasticsearch') + time.sleep(15) - ''' Start ''' - - assert nso.service_start('elasticsearch') - time.sleep(15) - assert nso.wait_for_service_status('elasticsearch', True) ''' Wait until node joins '''