Parallel-ssh

Latest version: v2.12.0

Safety actively analyzes 679296 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 9

2.3.0

+++++

Changes
-------

* ``SSHClient`` now starts buffering output from remote host, both standard output and standard error, when a command is run.
* ``SSHClient.read_output``, ``SSHClient.read_stderr`` and iterating on stdout/stderr from ``HostOutput`` now read from the internal buffer rather than the SSH channel directly.
* ``ParallelSSHClient.join`` no longer requires ``consume_output`` to be set in order to get exit codes without first reading output.
* ``ParallelSSHClient.join`` with timeout no longer consumes output by default. It is now possible to use ``join`` with a timeout and capture output after ``join`` completes.
* ``ParallelSSHClient.reset_output_generators`` is now a no-op and no longer required to be called after timeouts.
* ``HostOutput.stdout`` and ``stderr`` are now dynamic properties.
* Added ``HostOutput.read_timeout`` attribute. Can be used to see what read timeout was when ``run_command`` was called and to change timeout when next reading from ``HostOutput.stdout`` and ``stderr``.
* Added ``HostOutput.encoding`` attribute for encoding used when ``run_command`` was called. Encoding can now be changed for when next reading output.
* ``ParallelSSHClient.join`` with timeout no longer affects ``stdout`` or ``stderr`` read timeout set when ``run_command`` was called.
* LibSSH clients under ``pssh.clients.ssh`` now allow output to be read as it becomes available without waiting for remote command to finish first.
* Reading from output behaviour is now consistent across all client types - parallel and single clients under both ``pssh.clients.native`` and ``pssh.clients.ssh``.
* ``ParallelSSHClient.join`` can now be called without arguments and defaults to last ran commands.
* ``ParallelSSHClient.finished`` can now be called without arguments and defaults to last ran commands.


This is now possible:

.. code-block:: python

output = client.run_command(<..>)
client.join(output)
assert output[0].exit_code is not None

As is this:

.. code-block:: python

client.run_command(<..>, read_timeout=1)
client.join(output, timeout=1)
for line in output[0].stdout:
print(line)

Output can be read after and has separate timeout from join.

See `documentation for more examples on use of timeouts <https://parallel-ssh.readthedocs.io/en/latest/advanced.html#partial-output>`_.

2.2.0

+++++

Changes
-------

* New single host tunneling, SSH proxy, implementation for increased performance.
* Native ``SSHClient`` now accepts ``proxy_host``, ``proxy_port`` and associated parameters - see `API documentation <https://parallel-ssh.readthedocs.io/en/latest/config.html>`_.
* Proxy configuration can now be provided via ``HostConfig``.
* Added ``ParallelSSHClient.connect_auth`` function for connecting and authenticating to hosts in parallel.

2.1.0

+++++

Changes
-------

* Added certificate authentication support for the ``pssh.clients.ssh`` clients.

2.0.0

+++++

Changes
--------

See `Upgrading to API 2.0 <https://parallel-ssh.readthedocs.io/en/latest/api_upgrade_2_0.html>`_ for examples of code that will need updating.

* Removed paramiko clients and dependency.
* ``ParallelSSHClient.run_command`` now always returns a list of ``HostOutput`` - ``return_list`` argument is a no-op and may be removed.
* ``ParallelSSHClient.get_last_output`` now always returns a list of ``HostOutput``.
* ``SSHClient.run_command`` now returns ``HostOutput``.
* Removed deprecated since `1.0.0` ``HostOutput`` dictionary attributes.
* Removed deprecated since `1.0.0` imports and modules.
* Removed paramiko based ``load_private_key`` and ``read_openssh_config`` functions from ``pssh.utils``.
* Removed paramiko based ``pssh.tunnel``.
* Removed paramiko based ``pssh.agent``.
* Removed deprecated ``ParallelSSHClient.get_output`` function.
* Removed deprecated ``ParallelSSHClient.get_exit_code`` and ``get_exit_codes`` functions.
* Removed deprecated ``ParallelSSHClient`` ``host_config`` dictionary implementation - now list of ``HostConfig``.
* Removed ``HostOutput.cmd`` attribute.
* Removed ``ParallelSSHClient.host_clients`` attribute.
* Made ``ParallelSSHClient(timeout=<seconds>)`` a global timeout setting for all operations.
* Removed ``run_command(greenlet_timeout=<..>)`` argument - now uses global timeout setting.
* Renamed ``run_command`` ``timeout`` to ``read_timeout=<seconds>)`` for setting output read timeout individually - defaults to global timeout setting.
* Removed ``pssh.native`` package and native code.
* ``ParallelSSHClient.scp_send`` now supports ``copy_args`` keyword argument for providing per-host file name arguments like rest of ``scp_*`` and ``copy_*`` functionality.
* Changed exception names to end in ``Error`` from ``Exception`` - backwards compatible.
* ``UnknownHostException``, ``AuthenticationException``, ``ConnectionErrorException``, ``SSHException`` no longer available as imports ``from pssh`` - use ``from pssh.exceptions``.


Fixes
-----

* Removed now unnecessary locking around SSHClient initialisation so it can be parallelised - 219.
* ``ParallelSSHClient.join`` with encoding would not pass on encoding when reading from output buffers - 214.
* Clients could raise ``Timeout`` early when timeout settings were used with many hosts.


Packaging
---------

* Package architecture has changed to ``none-any``.

1.13.0

++++++

Changes
--------

* Added ``pssh.config.HostConfig`` for providing per-host configuration. Replaces dictionary ``host_config`` which is now deprecated. See `per-host configuration <https://parallel-ssh.readthedocs.io/en/latest/advanced.html#per-host-configuration>`_ documentation.
* ``ParallelSSHClient.scp_send`` and ``scp_recv`` with directory target path will now copy source file to directory keeping existing name instead of failing when recurse is off - 183.
* ``pssh.clients.ssh.SSHClient`` ``wait_finished`` timeout is now separate from ``SSHClient(timeout=<timeout>)`` session timeout.
* ``ParallelSSHClient.join`` with timeout now has finished and unfinished commands as ``Timeout`` exception arguments for use by client code.

Fixes
------

* ``ParallelSSHClient.copy_file`` with recurse enabled and absolute destination path would create empty directory in home directory of user - 197.
* ``ParallelSSHClient.copy_file`` and ``scp_recv`` with recurse enabled would not create remote directories when copying empty local directories.
* ``ParallelSSHClient.scp_send`` would require SFTP when recurse is off and remote destination path contains directory - 157.
* ``ParallelSSHClient.scp_recv`` could block infinitely on large - 200-300MB or more - files.
* ``SSHClient.wait_finished`` would not apply timeout value given.

1.12.1

++++++

Fixes
------

* Reading from output streams with timeout via `run_command(<..>, timeout=<timeout>)` would raise timeout early when trying to read from a stream with no data written to it while other streams have pending data - 180.

Page 4 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.