@@ -37,16 +37,15 @@ class SSHClient(object):
3737 """Wrapper class over paramiko.SSHClient with sane defaults
3838 Honours ~/.ssh/config and /etc/ssh/ssh_config entries for host username \
3939 overrides"""
40-
40+
4141 def __init__ (self , host ,
4242 user = None , password = None , port = None ,
4343 pkey = None , forward_ssh_agent = True ,
4444 num_retries = DEFAULT_RETRIES , agent = None , allow_agent = True ,
45- timeout = 10 , proxy_host = None , proxy_port = 22 ,
46- channel_timeout = None ):
45+ timeout = 10 , proxy_host = None , proxy_port = 22 , channel_timeout = None ):
4746 """Connect to host honouring any user set configuration in ~/.ssh/config \
4847 or /etc/ssh/ssh_config
49-
48+
5049 :param host: Hostname to connect to
5150 :type host: str
5251 :param user: (Optional) User to login as. Defaults to logged in user or \
@@ -129,12 +128,12 @@ def __init__(self, host,
129128 self ._connect_tunnel ()
130129 else :
131130 self ._connect (self .client , self .host , self .port )
132-
131+
133132 def _connect_tunnel (self ):
134133 """Connects to SSH server via an intermediate SSH tunnel server.
135134 client (me) -> tunnel (ssh server to proxy through) -> \
136135 destination (ssh server to run command)
137-
136+
138137 :rtype: `:mod:paramiko.SSHClient` Client to remote SSH destination
139138 via intermediate SSH tunnel server.
140139 """
@@ -154,10 +153,10 @@ def _connect_tunnel(self):
154153 raise ConnectionErrorException ("Error connecting to host '%s:%s' - %s" ,
155154 self .host , self .port ,
156155 str (error_type ))
157-
156+
158157 def _connect (self , client , host , port , sock = None , retries = 1 ):
159158 """Connect to host
160-
159+
161160 :raises: :mod:`pssh.exceptions.AuthenticationException` on authentication error
162161 :raises: :mod:`pssh.exceptions.UnknownHostException` on DNS resolution error
163162 :raises: :mod:`pssh.exceptions.ConnectionErrorException` on error connecting
@@ -204,10 +203,10 @@ def exec_command(self, command, sudo=False, user=None,
204203 shell = None ,
205204 use_shell = True , ** kwargs ):
206205 """Wrapper to :mod:`paramiko.SSHClient.exec_command`
207-
208- Opens a new SSH session with a new pty and runs command before yielding
206+
207+ Opens a new SSH session with a new pty and runs command before yielding
209208 the main gevent loop to allow other greenlets to execute.
210-
209+
211210 :param command: Shell command to execute
212211 :type command: str
213212 :param sudo: (Optional) Run with sudo. Defaults to False
@@ -264,12 +263,12 @@ def _make_sftp(self):
264263
265264 def _mkdir (self , sftp , directory ):
266265 """Make directory via SFTP channel
267-
266+
268267 :param sftp: SFTP client object
269268 :type sftp: :mod:`paramiko.SFTPClient`
270269 :param directory: Remote directory to create
271270 :type directory: str
272-
271+
273272 Catches and logs at error level remote IOErrors on creating directory.
274273 """
275274 try :
@@ -282,14 +281,14 @@ def _mkdir(self, sftp, directory):
282281
283282 def mkdir (self , sftp , directory ):
284283 """Make directory via SFTP channel.
285-
284+
286285 Parent paths in the directory are created if they do not exist.
287-
286+
288287 :param sftp: SFTP client object
289288 :type sftp: :mod:`paramiko.SFTPClient`
290289 :param directory: Remote directory to create
291290 :type directory: str
292-
291+
293292 Catches and logs at error level remote IOErrors on creating directory.
294293 """
295294 try :
@@ -319,17 +318,17 @@ def _copy_dir(self, local_dir, remote_dir):
319318
320319 def copy_file (self , local_file , remote_file , recurse = False ):
321320 """Copy local file to host via SFTP/SCP
322-
321+
323322 Copy is done natively using SFTP/SCP version 2 protocol, no scp command \
324323 is used or required.
325-
324+
326325 :param local_file: Local filepath to copy to remote host
327326 :type local_file: str
328327 :param remote_file: Remote filepath on remote host to copy file to
329328 :type remote_file: str
330329 :param recurse: Whether or not to descend into directories recursively.
331330 :type recurse: bool
332-
331+
333332 :raises: :mod:`ValueError` when a directory is supplied to local_file \
334333 and recurse is not set
335334 """
0 commit comments