Skip to content

Commit

Permalink
Continue on SSH exception
Browse files Browse the repository at this point in the history
  • Loading branch information
remibergsma committed Oct 25, 2023
1 parent 8166814 commit 869441f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cosmicops/objects/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 869441f

Please sign in to comment.