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
@@ -46,6 +48,8 @@ Run ``uname`` on two remote hosts in parallel with ``sudo``.
46
48
47
49
.. code-block:: python
48
50
51
+
from__future__import print_function
52
+
49
53
from pssh.pssh_client import ParallelSSHClient
50
54
51
55
hosts = ['myhost1', 'myhost2']
@@ -75,7 +79,7 @@ See `this post <https://parallel-ssh.org/post/parallel-ssh-libssh2>`_ for a perf
75
79
76
80
To make use of this new client, ``ParallelSSHClient`` can be imported from ``pssh.pssh2_client`` instead. Their respective APIs are almost identical.
77
81
78
-
The new client will become the default and will replace the current ``pssh.pssh_client`` in a new major version of the library - ``2.0.0`` - once remaining features have been implemented. The native client should be considered as *beta* status until the ``2.0.0`` release when it is made the default.
82
+
The new client will become the default and will replace the current ``pssh.pssh_client`` in a new major version of the library - ``2.0.0`` - once remaining features have been implemented.
79
83
80
84
The current default client will remain available as an option under a new name.
81
85
@@ -126,7 +130,7 @@ Once either standard output is iterated on *to completion*, or ``client.join(out
126
130
0
127
131
128
132
129
-
The client's ``join`` function can be used to block and wait for all parallel commands to finish:
133
+
The client's ``join`` function can be used to wait for all commands in output object to finish:
130
134
131
135
.. code-block:: python
132
136
@@ -136,6 +140,8 @@ Similarly, output and exit codes are available after ``client.join`` is called:
136
140
137
141
.. code-block:: python
138
142
143
+
from pprint import pprint
144
+
139
145
output = client.run_command('exit 0')
140
146
141
147
# Wait for commands to complete and gather exit codes.
@@ -157,11 +163,12 @@ Similarly, output and exit codes are available after ``client.join`` is called:
157
163
158
164
There is also a built in host logger that can be enabled to log output from remote hosts. The helper function ``pssh.utils.enable_host_logger`` will enable host logging to stdout.
159
165
160
-
To log output without having to iterate over output generators, the ``consume_output`` flag can be enabled - for example:
166
+
To log output without having to iterate over output generators, the ``consume_output`` flag *must* be enabled - for example:
@@ -238,7 +245,7 @@ Output *generation* is done remotely and has no effect on the event loop until o
238
245
User's group
239
246
*************
240
247
241
-
here is a public `ParallelSSH Google group <https://groups.google.com/forum/#!forum/parallelssh>`_ setup for this purpose - both posting and viewing are open to the public.
248
+
There is a public `ParallelSSH Google group <https://groups.google.com/forum/#!forum/parallelssh>`_ setup for this purpose - both posting and viewing are open to the public.
``parallel-ssh`` is a non-blocking parallel SSH client library.
22
24
23
-
It uses non-blocking asynchronous SSH sessions 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.
25
+
It uses non-blocking asynchronous SSH sessions and is to date the only publicly available non-blocking SSH client library, as well as the only non-blocking *parallel* SSH client library available for Python.
24
26
25
27
.. toctree::
26
28
:maxdepth:2
@@ -79,7 +81,6 @@ The API is mostly identical to the current clients, though some features are not
79
81
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/installation.rst
+74-7Lines changed: 74 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,13 @@ Installation is handled by Python's standard ``setuptools`` library and ``pip``.
7
7
Pip Install
8
8
------------
9
9
10
-
::
10
+
``pip`` may need to be updated to be able to install binary wheel packages.
11
11
12
-
pip install parallel-ssh
12
+
.. code-block:: shell
13
+
14
+
pip install -U pip
15
+
16
+
pip install parallel-ssh
13
17
14
18
If ``pip`` is not available on your Python platform, `see this installation guide <http://docs.python-guide.org/en/latest/starting/installation/>`_.
15
19
@@ -22,31 +26,94 @@ If you are running a deprecated Python version such as ``2.6`` you may need to i
22
26
23
27
For example, to install the ``1.0.0`` version, run the following.
24
28
25
-
.. code-block:: python
29
+
.. code-block:: shell
26
30
27
31
pip install parallel-ssh==1.0.0
28
32
29
33
``1.0.0`` is compatible with all Python versions over or equal to ``2.6``, including all of the ``3.x`` series.
30
34
31
35
Older versions such as `0.70.x` are compatible with Python ``2.5`` and ``2.x`` but not the ``3.x`` series.
32
36
33
-
Source Code
34
-
-------------
37
+
Dependencies
38
+
--------------
39
+
40
+
When installing from source, it is responsibility of user to satisfy dependencies. For pre-built binary wheel packages with dependencies included, see `Pip Install`_.
41
+
42
+
============ ================
43
+
Dependency Minimum Version
44
+
============ ================
45
+
``libssh2`` ``1.6``
46
+
``gevent`` ``1.1``
47
+
``paramiko`` ``1.15.3``
48
+
============ ================
49
+
50
+
51
+
Building from Source
52
+
----------------------
35
53
36
-
Parallel-SSH is hosted on GitHub and the repository can be cloned with the following
54
+
55
+
``parallel-ssh`` is hosted on GitHub and the repository can be cloned with the following
Or with `pip`'s development mode which will ensure local changes are made available:
68
+
Or with ``pip``'s development mode which will ensure local changes are made available:
49
69
50
70
.. code-block:: shell
51
71
52
72
pip install -e .
73
+
74
+
Building System Packages
75
+
--------------------------
76
+
77
+
For convenience, a script making use of Docker is provided at `ci/docker/build-packages.sh <https://github.com/ParallelSSH/parallel-ssh/blob/master/ci/docker/build-packages.sh>`_ that will build system packages for Centos/RedHat 6/7, Ubuntu 14.04/16.04, Debian 7/8 and Fedora 22/23/24.
78
+
79
+
Note that these packages make use of system libraries that may need to be updated to be compatible with ``parallel-ssh`` - see `Dependencies`_.
To build for only a specific system/distribution, run the two following commands, substituting distribution with the desired one from `ci/docker <https://github.com/ParallelSSH/parallel-ssh/blob/master/ci/docker>`_. See `existing Dockerfiles <https://github.com/ParallelSSH/parallel-ssh/tree/master/ci/docker/ubuntu16.04/Dockerfile>`_ for examples on how to create system packages for other distributions.
Copy file name to clipboardExpand all lines: doc/quickstart.rst
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,11 +129,25 @@ User/password authentication can be used by providing user name and password cre
129
129
Programmatic Private Key authentication
130
130
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131
131
132
-
It is also possible to programmatically use a private key for authentication.
132
+
It is also possible to programmatically use a private key for authentication.
133
133
134
-
The helper function :py:func:`load_private_key <pssh.utils.load_private_key>` is provided to easily load all possible key types. It takes either a file path or a file-like object.
134
+
Native Client
135
+
______________
135
136
136
-
:File path:
137
+
For the native client (``pssh.pssh2_client``), only private key filepath is needed. The corresponding public key *must* be available in the same directory as ``my_pkey.pub`` where private key file is ``my_pkey``. Public key file name and path will be made configurable in a future version.
138
+
139
+
.. code-block:: python
140
+
141
+
from pssh.pssh2_client import ParallelSSHClient
142
+
143
+
client = ParallelSSHClient(hosts, pkey='my_pkey')
144
+
145
+
Paramiko Client
146
+
__________________
147
+
148
+
For the paramiko based client, the helper function :py:func:`load_private_key <pssh.utils.load_private_key>` is provided to easily load all possible key types. It takes either a file path or a file-like object.
149
+
150
+
:File path:
137
151
.. code-block:: python
138
152
139
153
from pssh.pssh_client import ParallelSSHClient
@@ -142,6 +156,10 @@ The helper function :py:func:`load_private_key <pssh.utils.load_private_key>` is
142
156
pkey = load_private_key('my_pkey.pem')
143
157
client = ParallelSSHClient(hosts, pkey=pkey)
144
158
159
+
.. note::
160
+
161
+
The two available clients support different key types and authentication mechanisms - see Paramiko and libssh2 documentation for details, as well as `clients features comparison <ssh2.html>`_.
0 commit comments