Enhance message for image ssh auth
nodeutils.ssh_connect() offers an info message which suggest we attempted to connect to an instance using password authentication: Password auth exception. Try number 5... Change message to be more generic Include ip and username to better differentiate messages in the log spam. Example output: Auth exception for debian@10.0.0.42, Try number 5... Change-Id: Iea3c1cf3ae30919cbc6d147e16d383da91df5d75
This commit is contained in:
parent
b2f9546dcf
commit
90e3812c49
|
@ -54,7 +54,8 @@ def ssh_connect(ip, username, connect_kwargs={}, timeout=60):
|
|||
except paramiko.AuthenticationException as e:
|
||||
# This covers the case where the cloud user is created
|
||||
# after sshd is up (Fedora for example)
|
||||
log.info('Password auth exception. Try number %i...' % count)
|
||||
log.info('Auth exception for %s@%s. Try number %i...' %
|
||||
(username, ip, count))
|
||||
except socket.error as e:
|
||||
if e[0] not in [errno.ECONNREFUSED, errno.EHOSTUNREACH, None]:
|
||||
log.exception('Exception while testing ssh access:')
|
||||
|
|
Loading…
Reference in New Issue