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 <pabelanger@redhat.com>
This commit is contained in:
parent
7e3a620fa9
commit
aebd030a32
@ -54,6 +54,11 @@ def ssh_connect(ip, username, connect_kwargs={}, timeout=60):
|
||||
try:
|
||||
client = SSHClient(ip, username, **connect_kwargs)
|
||||
break
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user