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:
Antoine Musso 2015-09-11 12:34:09 +02:00
parent b2f9546dcf
commit 90e3812c49
1 changed files with 2 additions and 1 deletions

View File

@ -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:')