Skip to content

Commit ed8dd78

Browse files
author
Dan
committed
Updated ssh exception to not use deprecated message from base exception. Updated ssh exception test to use user/password login to avoid authentication error.
1 parent 6ed61ab commit ed8dd78

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pssh/ssh_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ def _connect(self, client, host, port, sock=None, retries=1):
177177
# SSHException is more general so should be below other types
178178
# of SSH failure
179179
except paramiko.SSHException, ex:
180-
logger.error("General SSH error - %s", ex)
181-
raise SSHException(ex.message, host, port)
180+
msg = "General SSH error - %s" % (ex,)
181+
logger.error(msg)
182+
raise SSHException(msg, host, port)
182183

183184
def exec_command(self, command, sudo=False, user=None, **kwargs):
184185
"""Wrapper to :mod:`paramiko.SSHClient.exec_command`

tests/test_pssh_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ def test_ssh_exception(self):
504504
server = start_server(_socket, ssh_exception=True)
505505
hosts = [host]
506506
client = ParallelSSHClient(hosts, port=port,
507-
pkey=self.user_key)
507+
user='fakey', password='fakey',
508+
pkey=paramiko.RSAKey.generate(1024))
508509
output = client.run_command(self.fake_cmd, stop_on_errors=False)
509510
client.pool.join()
510511
self.assertTrue('exception' in output[host],

0 commit comments

Comments
 (0)