@@ -60,6 +60,11 @@ class AuthenticationException(Exception):
6060 pass
6161
6262
63+ class ProxyCommandException (Exception ):
64+ """Raised on ProxyCommand error - ProxyCommand configured exited with error"""
65+ pass
66+
67+
6368class SSHClient (object ):
6469 """Wrapper class over paramiko.SSHClient with sane defaults
6570 Honours ~/.ssh/config and /etc/ssh/ssh_config entries for host username \
@@ -86,7 +91,9 @@ def __init__(self, host,
8691 :type pkey: :mod:`paramiko.PKey`
8792 :raises: :mod:`pssh.AuthenticationException` on authentication error
8893 :raises: :mod:`pssh.UnknownHostException` on DNS resolution error
89- :raises: :mod:`pssh.ConnectionErrorException` on error connecting"""
94+ :raises: :mod:`pssh.ConnectionErrorException` on error connecting
95+ :raises: :mod:`pssh.ProxyCommandError` on error with ProxyCommand \
96+ configured"""
9097 ssh_config = paramiko .SSHConfig ()
9198 _ssh_config_file = os .path .sep .join ([os .path .expanduser ('~' ),
9299 '.ssh' ,
@@ -145,6 +152,10 @@ def _connect(self, retries=1):
145152 self .port ,))
146153 except paramiko .AuthenticationException , e :
147154 raise AuthenticationException (e )
155+ except paramiko .ProxyCommandFailure , e :
156+ logger .error ("Error executing ProxyCommand - %s" % (
157+ e .message ,))
158+ raise ProxyCommandException (e .message )
148159
149160 def exec_command (self , command , sudo = False , ** kwargs ):
150161 """Wrapper to :mod:`paramiko.SSHClient.exec_command`
0 commit comments