Skip to content

Commit d22eadb

Browse files
committed
Updated documentation
1 parent 2a2fcf6 commit d22eadb

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Welcome to Parallel-SSH's documentation!
1010
:maxdepth: 4
1111

1212
.. automodule:: pssh
13-
:members: ParallelSSHClient, SSHClient, UnknownHostException, ConnectionErrorException, AuthenticationException
13+
:members: ParallelSSHClient, SSHClient, UnknownHostException, ConnectionErrorException, AuthenticationException, ProxyCommandException
1414
:undoc-members:
1515

1616

pssh.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,19 @@ def __init__(self, host,
9191
:param pkey: (Optional) Client's private key to be used to connect with
9292
:type pkey: :mod:`paramiko.PKey`
9393
:param forward_ssh_agent: (Optional) Turn on SSH agent forwarding - \
94-
equivalent to `ssh -A` from the `ssh` command line utility.
94+
equivalent to `ssh -A` from the `ssh` command line utility. \
9595
Defaults to True if not set.
9696
:type forward_ssh_agent: bool
9797
:param _agent: (Optional) Override SSH agent object with the provided. \
9898
This allows for overriding of the default paramiko behaviour of \
99-
connecting to local SSH agent to lookup keys with our own SSH agent.
99+
connecting to local SSH agent to lookup keys with our own SSH agent. \
100100
Only really useful for testing, hence the internal variable prefix.
101101
:type _agent: :mod:`paramiko.agent.Agent`
102102
:raises: :mod:`pssh.AuthenticationException` on authentication error
103103
:raises: :mod:`pssh.UnknownHostException` on DNS resolution error
104104
:raises: :mod:`pssh.ConnectionErrorException` on error connecting
105-
:raises: :mod:`pssh.ProxyCommandError` on error with ProxyCommand \
106-
configured"""
105+
:raises: :mod:`pssh.ProxyCommandException` on error with ProxyCommand configured
106+
"""
107107
ssh_config = paramiko.SSHConfig()
108108
_ssh_config_file = os.path.sep.join([os.path.expanduser('~'),
109109
'.ssh',
@@ -262,9 +262,9 @@ class ParallelSSHClient(object):
262262
"""Uses :mod:`pssh.SSHClient`, performs tasks over SSH on multiple hosts in \
263263
parallel.
264264
265-
Connections to hosts are established in parallel when an object of this
266-
class is created, therefor any connection and/or authentication exceptions \
267-
will happen on creation and need to be caught."""
265+
Connections to hosts are established in parallel when ``exec_command`` is called,
266+
therefor any connection and/or authentication exceptions will happen on the
267+
call to ``exec_command`` and need to be caught."""
268268

269269
def __init__(self, hosts,
270270
user=None, password=None, port=None, pkey=None,
@@ -289,16 +289,17 @@ def __init__(self, hosts,
289289
:raises: :mod:`pssh.AuthenticationException` on authentication error
290290
:raises: :mod:`pssh.UnknownHostException` on DNS resolution error
291291
:raises: :mod:`pssh.ConnectionErrorException` on error connecting
292+
:raises: :mod:`pssh.ProxyCommandException` on error with ProxyCommand configured
292293
293294
**Example**
294295
295296
>>> from pssh import ParallelSSHClient, AuthenticationException,\
296297
UnknownHostException, ConnectionErrorException
298+
>>> client = ParallelSSHClient(['myhost1', 'myhost2'])
297299
>>> try:
298-
>>> ... client = ParallelSSHClient(['myhost1', 'myhost2'])
300+
>>> ... cmds = client.exec_command('ls -ltrh /tmp/aasdfasdf', sudo = True)
299301
>>> except (AuthenticationException, UnknownHostException, ConnectionErrorException):
300302
>>> ... return
301-
>>> cmds = client.exec_command('ls -ltrh /tmp/aasdfasdf', sudo = True)
302303
>>> output = [client.get_stdout(cmd) for cmd in cmds]
303304
[myhost1] ls: cannot access /tmp/aasdfasdf: No such file or directory
304305
[myhost2] ls: cannot access /tmp/aasdfasdf: No such file or directory
@@ -309,11 +310,11 @@ def __init__(self, hosts,
309310
310311
>>> from pssh import ParallelSSHClient, AuthenticationException,\
311312
UnknownHostException, ConnectionErrorException
313+
>>> client = ParallelSSHClient(['myhost1', 'myhost2'])
312314
>>> try:
313-
>>> ... client = ParallelSSHClient(['myhost1', 'myhost2'])
315+
>>> ... cmds = client.exec_command('ls -ltrh /tmp/aasdfasdf', sudo = True)
314316
>>> except (AuthenticationException, UnknownHostException, ConnectionErrorException):
315317
>>> ... return
316-
>>> cmds = client.exec_command('ls -ltrh /tmp/aasdfasdf', sudo = True)
317318
>>> output = [client.get_stdout(cmd, return_buffers=True) for cmd in cmds]
318319
>>> print output
319320
[{'myhost1': {'exit_code': 2,

0 commit comments

Comments
 (0)