Retry SSHExceptions in nodepool

Today, when SSHExceptions are raise, nodepool will abort communication
with the node. Now, nodepool will properly trap them and try again
until the SSH timeout has been raised.

This help with potential race conditions with openssh-server and
nodepool, where nodes would restart sshd after nodepool has
established a connection.

Change-Id: I40bfa1b1af6e4e75f8f14c597c28407ed08023de
Signed-off-by: Paul Belanger <>
Paul Belanger 7 years ago
parent 7e3a620fa9
commit aebd030a32
No known key found for this signature in database
GPG Key ID: 611A80832067AF38

@ -54,6 +54,11 @@ def ssh_connect(ip, username, connect_kwargs={}, timeout=60):
client = SSHClient(ip, username, **connect_kwargs)
except paramiko.SSHException as e:
# NOTE(pabelanger): Currently paramiko only returns a string with
# error code. If we want finer granularity we'll need to regex the
# string.
log.exception('Failed to negotiate SSH: %s' % (e))
except paramiko.AuthenticationException as e:
# This covers the case where the cloud user is created
# after sshd is up (Fedora for example)