Skip to content

Commit

Permalink
deploy: Sleep 10 seconds if ssh isn't available
Browse files Browse the repository at this point in the history
If ssh isn't available, sleep 10 seconds before running "wait_for_ssh".
This condition will reduce cpu and log messages when running "lago
deploy".

Signed-off-by: gbenhaim <galbh2@gmail.com>
  • Loading branch information
gbenhaim committed Dec 5, 2017
1 parent c8ad0db commit 167d99a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lago/prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import shutil
import subprocess
from textwrap import dedent
import time
import urlparse
import urllib
import uuid
Expand Down Expand Up @@ -1620,7 +1621,9 @@ def _deploy_host(self, host):
return

with LogTask('Wait for ssh connectivity'):
host.wait_for_ssh()
if not host.ssh_reachable(tries=1):
time.sleep(10)
host.wait_for_ssh()

for script in deploy_scripts:
script = os.path.expanduser(os.path.expandvars(script))
Expand Down

0 comments on commit 167d99a

Please sign in to comment.