From 167d99a621af9659f50baf35a6d929b37c7f1607 Mon Sep 17 00:00:00 2001 From: gbenhaim Date: Mon, 4 Dec 2017 17:17:51 +0200 Subject: [PATCH] deploy: Sleep 10 seconds if ssh isn't available 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 --- lago/prefix.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lago/prefix.py b/lago/prefix.py index d9c828b8..3a2d5eda 100644 --- a/lago/prefix.py +++ b/lago/prefix.py @@ -26,6 +26,7 @@ import shutil import subprocess from textwrap import dedent +import time import urlparse import urllib import uuid @@ -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))