Skip to content

Commit

Permalink
Switch the log of SSH retries to display
Browse files Browse the repository at this point in the history
only if the 1st connection failed and we retry.
It's just annoying to see it on every SSH connection.
  • Loading branch information
Yaniv Kaul committed Nov 28, 2017
1 parent 0ea069a commit 1299092
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lago/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,6 @@ def get_ssh_client(
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy(), )
while ssh_tries > 0:
LOGGER.debug(
'Still got %d tries for %s',
ssh_tries,
host_name,
)
try:
client.connect(
ip_addr,
Expand All @@ -360,6 +355,11 @@ def get_ssh_client(
except EOFError as err:
LOGGER.debug('EOFError connecting to %s: %s', host_name, err)
ssh_tries -= 1
LOGGER.debug(
'Still got %d tries for %s',
ssh_tries,
host_name,
)
time.sleep(1)
else:
end_time = time.time()
Expand Down

0 comments on commit 1299092

Please sign in to comment.