diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2015-03-05 09:54:41 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2015-03-05 10:10:33 -0800 |
commit | b0a5ca8e3747a34082895bbd170a617f76ebe7e5 (patch) | |
tree | 316df20fa270b60164ceb88f36ad393f2a8c293c | |
parent | bb7acdc81f8c318fe844e3c61d0ee03d03a70bcd (diff) |
Rename new exception class to be less generic
Re #22
-rw-r--r-- | paramiko/client.py | 4 | ||||
-rw-r--r-- | paramiko/ssh_exception.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/paramiko/client.py b/paramiko/client.py index 6c48b269..e10e9da7 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -37,7 +37,7 @@ from paramiko.py3compat import string_types from paramiko.resource import ResourceManager from paramiko.rsakey import RSAKey from paramiko.ssh_exception import ( - SSHException, BadHostKeyException, ConnectionError + SSHException, BadHostKeyException, NoValidConnectionsError ) from paramiko.transport import Transport from paramiko.util import retry_on_signal, ClosingContextManager @@ -307,7 +307,7 @@ class SSHClient (ClosingContextManager): # ones, of a subclass that client code should still be watching for # (socket.error) if len(errors) == len(to_try): - raise ConnectionError(errors) + raise NoValidConnectionsError(errors) t = self._transport = Transport(sock, gss_kex=gss_kex, gss_deleg_creds=gss_deleg_creds) t.use_compression(compress=compress) diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py index 7e6f2568..169dad81 100644 --- a/paramiko/ssh_exception.py +++ b/paramiko/ssh_exception.py @@ -133,7 +133,7 @@ class ProxyCommandFailure (SSHException): self.args = (command, error, ) -class ConnectionError(socket.error): +class NoValidConnectionsError(socket.error): """ High-level socket error wrapping 1+ actual socket.error objects. @@ -155,7 +155,7 @@ class ConnectionError(socket.error): body = ', '.join([x[0] for x in addrs[:-1]]) tail = addrs[-1][0] msg = "Unable to connect to port {0} at {1} or {2}" - super(ConnectionError, self).__init__( + super(NoValidConnectionsError, self).__init__( msg.format(addrs[0][1], body, tail) ) self.errors = errors |