diff --git a/cosmicops/objects/host.py b/cosmicops/objects/host.py index 1308b13..c171019 100644 --- a/cosmicops/objects/host.py +++ b/cosmicops/objects/host.py @@ -420,12 +420,12 @@ def wait_until_online(self): logging.info(f"Would wait for '{self['name']}' to come back online") else: logging.info(f"Waiting for '{self['name']}' to come back online", self.log_to_slack) - with click_spinner.spinner(): - # adding retry tests, so we need to be able to connect to SSH three times in one minute - # before we consider the host up - tests = 1 + # adding retry tests, so we need to be able to connect to SSH three times in one minute + # before we consider the host up + tests = 1 + while tests <= 3: logging.info(f"Waiting for SSH connection, attempt {tests} of 3", False) - while tests <= 3: + with click_spinner.spinner(): while True: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.settimeout(5) @@ -434,7 +434,7 @@ def wait_until_online(self): if result == 0: break time.sleep(20) - tests += 1 + tests += 1 if self.dry_run: logging.info(f"Would wait for libvirt on '{self['name']}'") diff --git a/rolling_reboot.py b/rolling_reboot.py index 31b5d18..38ba83e 100755 --- a/rolling_reboot.py +++ b/rolling_reboot.py @@ -46,11 +46,11 @@ help='Script to run on host after live migrations have completed') @click.option('--post-reboot-script', metavar='