You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/advanced.rst
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,7 @@
1
-
.. contents::
2
-
3
-
4
1
Advanced Usage
5
2
=================
6
3
7
-
There are several more advanced use cases of `ParallelSSH`, such as tunneling (aka proxying) via an intermediate SSH server and per-host configuration and command substitution among others.
4
+
There are several more advanced usage features of ``parallel-ssh``, such as tunnelling (aka proxying) via an intermediate SSH server and per-host configuration and command substitution among others.
Copy file name to clipboardExpand all lines: doc/index.rst
+35-4Lines changed: 35 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,26 +22,29 @@ Parallel-SSH Documentation
22
22
:alt:Latest documentation
23
23
24
24
25
-
``Parallel-SSH`` is a parallel SSH client library. It uses asynchronous SSH connections and is, to date, the only publicly available asynchronous SSH client library for Python, as well as the only asynchronous *parallel* SSH client library available for Python.
25
+
``parallel-ssh`` is a parallel SSH client library.
26
+
27
+
It uses asynchronous non-blocking SSH connections and is, to date, the only publicly available non-blocking SSH client library for Python, as well as the only non-blocking *parallel* SSH client library available for Python.
26
28
27
29
.. toctree::
28
30
:maxdepth:2
29
31
30
32
introduction
31
33
installation
32
34
quickstart
35
+
ssh2
33
36
advanced
34
37
api
35
38
36
39
In a nutshell
37
40
**************
38
41
39
42
.. code-block:: python
40
-
43
+
41
44
from__future__import print_function
42
-
45
+
43
46
from pssh.pssh_client import ParallelSSHClient
44
-
47
+
45
48
client = ParallelSSHClient(['localhost'])
46
49
output = client.run_command('whoami')
47
50
for line in output['localhost'].stdout:
@@ -52,6 +55,34 @@ In a nutshell
52
55
53
56
<your username here>
54
57
58
+
`ssh2-python` (`libssh2`) based clients
59
+
******************************************
60
+
61
+
As of version ``1.2.0``, new single host and parallel clients are available based on the ``libssh2`` C library via its ``ssh2-python`` wrapper.
62
+
63
+
They offer significantly enhanced performance and stability, at much less overhead, with a native non-blocking mode meaning *no monkey patching of the Python standard library* when using the new clients.
64
+
65
+
To use them, import from ``pssh2_client`` or ``ssh2_client`` for the parallel and single clients respectively.
66
+
67
+
.. code-block:: python
68
+
69
+
from__future__import print_function
70
+
71
+
from pssh.pssh2_client import ParallelSSHClient
72
+
73
+
client = ParallelSSHClient(['localhost'])
74
+
output = client.run_command('whoami')
75
+
for line in output['localhost'].stdout:
76
+
print(line)
77
+
78
+
The API is mostly identical to the current clients, though some features are not yet supported. See `client feature comparison <ssh2.html>`_ section for how feature support differs between the two clients.
79
+
80
+
.. note::
81
+
82
+
From version ``2.x.x`` onwards, the ``ssh2-python`` based clients will *become the default*, replacing the current ``pssh_client.ParallelSSHClient``, with the current clients renamed.
Copy file name to clipboardExpand all lines: doc/quickstart.rst
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,3 @@
1
-
.. contents::
2
-
3
1
***********
4
2
Quickstart
5
3
***********
@@ -69,7 +67,7 @@ There is nothing special needed to ensure output is available.
69
67
70
68
Please note that retrieving all of a command's standard output by definition requires that the command has completed.
71
69
72
-
Iterating over ``stdout`` for any host *to completion* will therefor *block* until that host's command has completed unless interrupted.
70
+
Iterating over ``stdout`` for any host *to completion* will therefor *only complete* when that host's command has completed unless interrupted.
73
71
74
72
``stdout`` is a generator. Iterating over it will consume the remote standard output stream via the network as it becomes available. To retrieve all of stdout can wrap it with list, per below.
For the ``ssh2-python`` (``libssh2``) based clients, not all features supported by the paramiko based clients are currently supported by the underlying library or implemented in ``parallel-ssh``.
5
+
6
+
Below is a comparison of the differing feature support for the two client types.
If any of these features are required for a use case, then the paramiko based clients should be used instead. In all other cases the ``ssh2-python`` clients are preferred.
0 commit comments