Skip to content

Commit 57dd5d6

Browse files
Danpkittenis
authored andcommitted
Updated copy file docstrings
1 parent 5c1b97a commit 57dd5d6

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pssh/pssh_client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,16 +749,26 @@ def get_stdout(self, greenlet, return_buffers=False):
749749

750750
def copy_file(self, local_file, remote_file, recurse=False):
751751
"""Copy local file to remote file in parallel
752-
752+
753+
This function returns a list of greenlets which can be
754+
`join`ed on to wait for completion.
755+
756+
Use `.get` on each greenlet to raise any exceptions from them.
757+
758+
Exceptions listed here are raised when `.get` is called on each
759+
greenlet, not this function itself.
760+
753761
:param local_file: Local filepath to copy to remote host
754762
:type local_file: str
755763
:param remote_file: Remote filepath on remote host to copy file to
756764
:type remote_file: str
757765
:param recurse: Whether or not to descend into directories recursively.
758766
:type recurse: bool
759-
767+
760768
:raises: :mod:`ValueError` when a directory is supplied to local_file \
761769
and recurse is not set
770+
:raises: :mod:`IOError` on I/O errors writing files
771+
:raises: :mod:`OSError` on OS errors like permission denied
762772
763773
.. note ::
764774

pssh/ssh_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ def copy_file(self, local_file, remote_file, recurse=False):
351351
352352
:raises: :mod:`ValueError` when a directory is supplied to ``local_file`` \
353353
and ``recurse`` is not set
354+
:raises: :mod:`IOError` on I/O errors writing files
355+
:raises: :mod:`OSError` on OS errors like permission denied
354356
"""
355357
if os.path.isdir(local_file) and recurse:
356358
return self._copy_dir(local_file, remote_file)

0 commit comments

Comments
 (0)