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: README.rst
+48-34Lines changed: 48 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,9 @@
1
1
parallel-ssh
2
2
============
3
3
4
-
Library for running asynchronous parallel SSH commands over many hosts.
4
+
Asynchronous parallel SSH client library.
5
5
6
-
parallel-ssh uses asychronous network requests - there is *no* multi-threading or multi-processing used.
7
-
8
-
This is a *requirement* for commands on many (hundreds/thousands/hundreds of thousands) of hosts which would grind a system to a halt simply by having so many processes/threads all wanting to execute if done with multi-threading/processing.
6
+
Run commands via SSH over tens/hundreds/thousands+ number of servers asynchronously and with minimal system load on the client host.
Stdout and stderr buffers are available in output. Iterating on them can be used to get output as it becomes available. Iteration ends *only when command has finished*.
Joining on the connection pool can be used to block and wait for all parallel commands to finish if reading stdout/stderr is not required.
59
+
Exit codes become available once stdout/stderr is iterated on or `client.join(output)` is called.
56
60
57
-
>>> client.pool.join()
61
+
::
62
+
63
+
for host in output:
64
+
print output[host]['exit_code']
65
+
0
66
+
0
67
+
68
+
Joining on the connection pool can be used to block and wait for all parallel commands to finish if output is not required. ::
69
+
70
+
client.pool.join()
58
71
59
72
60
73
**************************
@@ -75,7 +88,7 @@ Frequently asked questions
75
88
Is Windows supported?
76
89
77
90
:A:
78
-
The library installs and works on Windows though not formally supported as unit tests are currently posix system only.
91
+
The library installs and works on Windows though not formally supported as unit tests are currently Posix system based.
79
92
80
93
Pip versions >= 8.0 are required for binary package installation of `gevent` on Windows, a dependency of `ParallelSSH`.
81
94
@@ -111,11 +124,11 @@ Frequently asked questions
111
124
Is there a way to programmatically provide an SSH key?
112
125
113
126
:A:
114
-
Yes, use the `pkey` parameter of the `ParallelSSHClient class <http://parallel-ssh.readthedocs.org/en/latest/#pssh.ParallelSSHClient>`_. There is a `load_private_key` helper function in `pssh.utils` that can be used to load any key type. For example:
127
+
Yes, use the `pkey` parameter of the `ParallelSSHClient class <http://parallel-ssh.readthedocs.org/en/latest/#pssh.ParallelSSHClient>`_. There is a `load_private_key` helper function in `pssh.utils` that can be used to load any key type. For example::
Copy file name to clipboardExpand all lines: embedded_server/embedded_server.py
+18-5Lines changed: 18 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,24 @@
18
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
19
20
20
"""
21
-
Fake SSH server to test our SSH clients.
22
-
Supports execution of commands via exec_command. Does _not_ support interactive \
23
-
shells, our clients do not use them.
24
-
Server private key is hardcoded, server listen code inspired by demo_server.py in \
25
-
paramiko repository
21
+
Embedded SSH server to test our SSH clients.
22
+
23
+
Implements:
24
+
* Execution of commands via exec_command
25
+
* Public key and password auth
26
+
* Direct TCP tunneling
27
+
* SSH agent forwarding
28
+
* Stub SFTP server from Paramiko
29
+
* Forced authentication failure
30
+
31
+
Does _not_ support interactive shells, our clients do not use them.
32
+
33
+
Server private key is hardcoded. Server listen code inspired by demo_server.py in \
34
+
Paramiko repository.
35
+
36
+
Server runs asynchronously in its own greenlet. Call `start_server` with a new `multiprocessing.Process` to run it on a new process with its own event loop.
37
+
38
+
*Warning* - Note that commands, with or without a shell, are actually run on the system running this server. Destructive commands will actually affect the system as permissions of user running the server allow. *Use at your own risk*.
0 commit comments