From 57dd5d6427706b6b6aa7bb782aad402a2653d79c Mon Sep 17 00:00:00 2001 From: Dan <22e889d8@opayq.com> Date: Fri, 18 Nov 2016 16:00:10 +0000 Subject: [PATCH] Updated copy file docstrings --- pssh/pssh_client.py | 14 ++++++++++++-- pssh/ssh_client.py | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pssh/pssh_client.py b/pssh/pssh_client.py index b61f4ec4..7d5a8708 100644 --- a/pssh/pssh_client.py +++ b/pssh/pssh_client.py @@ -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 :: diff --git a/pssh/ssh_client.py b/pssh/ssh_client.py index ffdeb773..b5cf14ad 100644 --- a/pssh/ssh_client.py +++ b/pssh/ssh_client.py @@ -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)