Include ip address for ssh_connect exception
Add some sort of server information about our failed ssh_connect attempts. Currently we don't expose any information about the host. 2016-08-23 16:26:11,894 ERROR nodepool.utils: Exception while testing ssh access: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/nodepool/nodeutils.py", line 55, in ssh_connect client = SSHClient(ip, username, **connect_kwargs) File "/usr/local/lib/python2.7/dist-packages/nodepool/sshclient.py", line 30, in __init__ key_filename=key_filename) File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line 305, in connect retry_on_signal(lambda: sock.connect(addr)) File "/usr/local/lib/python2.7/dist-packages/paramiko/util.py", line 270, in retry_on_signal return function() File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line 305, in <lambda> retry_on_signal(lambda: sock.connect(addr)) File "/usr/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) error: [Errno 110] Connection timed out Change-Id: I5705798c91b228a7be2788c33c5a128653b24bbe Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
@@ -61,7 +61,8 @@ def ssh_connect(ip, username, connect_kwargs={}, timeout=60):
|
||||
(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:')
|
||||
log.exception(
|
||||
'Exception while testing ssh access to %s:' % ip)
|
||||
|
||||
out = client.ssh("test ssh access", "echo access okay", output=True)
|
||||
if "access okay" in out:
|
||||
|
Reference in New Issue
Block a user