diff --git a/cosmicops/objects/host.py b/cosmicops/objects/host.py index c171019..cf60e54 100644 --- a/cosmicops/objects/host.py +++ b/cosmicops/objects/host.py @@ -429,7 +429,11 @@ def wait_until_online(self): while True: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.settimeout(5) - result = s.connect_ex((self['name'], 22)) + try: + result = s.connect_ex((self['name'], 22)) + except Exception as e: + logging.warning(f'Connection failed due to {e}') + result = 1 if result == 0: break