Skip to content

Commit

Permalink
after reboot of node make sure ssh process is active before declaring…
Browse files Browse the repository at this point in the history
… node as UP

Change-Id: I1b9877ad884c9234de59d876d8d13989809af81b
  • Loading branch information
shettyp committed Oct 6, 2014
1 parent 61f7355 commit 012c5a6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions fabfile/tasks/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,20 @@ def wait_till_all_up(attempts=90, interval=10, node=None, waitdown=True, contrai

print 'Given Nodes are down... Waiting for nodes to come back'
for node in nodes:
user, hostip = node.split('@')
count = 0
with hide('everything'):
with settings(host_string=node, timeout=int(interval),
connection_attempts=int(attempts),
linewise=True, warn_only=True,
password=env.passwords[node]):
connections.connect(env.host_string)
while not verify_sshd(hostip,
user,
env.passwords[node]):
sys.stdout.write('.')
sleep(int(interval))
count+=1
if count <= attempts:
continue
else:
print 'Timed out waiting for node (%s) to come back up...' %node
sys.exit(1)
return 0

def enable_haproxy():
Expand Down

0 comments on commit 012c5a6

Please sign in to comment.