Skip to content

Commit

Permalink
Updated copy file docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan authored and pkittenis committed Nov 19, 2016
1 parent 5c1b97a commit 57dd5d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pssh/pssh_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,16 +749,26 @@ def get_stdout(self, greenlet, return_buffers=False):

def copy_file(self, local_file, remote_file, recurse=False):
"""Copy local file to remote file in parallel
This function returns a list of greenlets which can be
`join`ed on to wait for completion.
Use `.get` on each greenlet to raise any exceptions from them.
Exceptions listed here are raised when `.get` is called on each
greenlet, not this function itself.
:param local_file: Local filepath to copy to remote host
:type local_file: str
:param remote_file: Remote filepath on remote host to copy file to
:type remote_file: str
:param recurse: Whether or not to descend into directories recursively.
:type recurse: bool
:raises: :mod:`ValueError` when a directory is supplied to local_file \
and recurse is not set
:raises: :mod:`IOError` on I/O errors writing files
:raises: :mod:`OSError` on OS errors like permission denied
.. note ::
Expand Down
2 changes: 2 additions & 0 deletions pssh/ssh_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ def copy_file(self, local_file, remote_file, recurse=False):
:raises: :mod:`ValueError` when a directory is supplied to ``local_file`` \
and ``recurse`` is not set
:raises: :mod:`IOError` on I/O errors writing files
:raises: :mod:`OSError` on OS errors like permission denied
"""
if os.path.isdir(local_file) and recurse:
return self._copy_dir(local_file, remote_file)
Expand Down

0 comments on commit 57dd5d6

Please sign in to comment.