Skip to content

Commit

Permalink
New output (#201)
Browse files Browse the repository at this point in the history
* Added optional list of host output return type from run_command.
* Updated documentation for optional new output. Updated new output tests.
* Added new single client holding object to parallel client to handle new output return type.
* Updated paramiko parallel client for base changes to host client object type. Removed flaky paramiko tests (client deprecated).
* Updated gitignore
* Updated travis and appveyor python versions.
* Added single client disconnection on parallel client deletion - resolves #175 
* Added socket closed test on parallel client deletion.
* Switched tests to pytest.
* Rebuild cython sources.
* Skip flaky test on py2
* Switched manylinux builds to 2010
* Updated changelog. Added client.cmds test for new output. Added check for output type in get_output.
  • Loading branch information
pkittenis authored Aug 14, 2020
1 parent 8b7bb4b commit d961c42
Show file tree
Hide file tree
Showing 19 changed files with 654 additions and 322 deletions.
56 changes: 7 additions & 49 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,25 @@ environment:
PYPI_PASS:
secure: x+dF0A8BZUf2IrPNRN1O0w==
matrix:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "32"
MSVC: "Visual Studio 9"
ARCH: i386

- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"
MSVC: "Visual Studio 9"
ARCH: x64_86

- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "32"
MSVC: "Visual Studio 10"
ARCH: i386

- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "64"
MSVC: "Visual Studio 10 Win64"
ARCH: x64_86

- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "32"
MSVC: "Visual Studio 14"
ARCH: i386

- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "64"
MSVC: "Visual Studio 14 Win64"
ARCH: x64_86

- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "32"
MSVC: "Visual Studio 14"
ARCH: i386

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
MSVC: "Visual Studio 14 Win64"
ARCH: x64_86

# No gevent 3.7 32-bit wheel available, source build fails.
# - PYTHON: "C:\\Python37"
# PYTHON_VERSION: "3.7"
# PYTHON_ARCH: "32"
# MSVC: "Visual Studio 14"
# ARCH: i386

- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
MSVC: "Visual Studio 14 Win64"
ARCH: x64_86

- PYTHON: "C:\\Python38-x64"
PYTHON_VERSION: "3.8"
PYTHON_ARCH: "64"
MSVC: "Visual Studio 14 Win64"
ARCH: x64_86


install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*~
*.py[cod]
.idea

# C extensions
*.so
Expand Down Expand Up @@ -34,3 +35,12 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject

# Virtual Environments
env
env_2
env_3
pypy

# Documentation builds
doc/_build
108 changes: 44 additions & 64 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ cache:
- pip
- directories:
- "$HOME/.pyenv"
- "$HOME/Library/Caches/Homebrew"
- "$HOME/.git/lfs"
notifications:
email: false
services:
- docker
python:
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8
addons:
apt:
packages:
Expand All @@ -22,13 +24,13 @@ addons:
before_install:
- pip install -U pip setuptools
install:
- pip install -r requirements_dev.txt
- pip install -U -r requirements_dev.txt
script:
# For testing SSH agent related functionality
- eval `ssh-agent -s`
- nosetests --with-coverage --cover-package=pssh --nologcapture tests/test_native_tunnel.py
- nosetests --with-coverage --cover-package=pssh tests/test_native_*_client.py
- nosetests --with-coverage --cover-package=pssh tests/test_paramiko*.py
- pytest --reruns 5 --cov-append --cov=pssh -s tests/test_native_tunnel.py
- pytest --reruns 5 --cov-append --cov=pssh -s tests/test_native_*_client.py
- pytest --reruns 5 --cov-append --cov=pssh -s tests/test_paramiko*.py
- flake8 pssh
- cd doc; make html; cd ..
# Test building from source distribution
Expand Down Expand Up @@ -71,32 +73,15 @@ jobs:
- &osx-wheels
stage: build packages
os: osx
osx_image: xcode8
osx_image: xcode11.6
env:
- PYENV: 3.6.4
- PYENV: 3.6.11
before_install:
- brew update
- brew link --overwrite python@2 || brew install python@2 || brew link --overwrite python@2
- which python2
- sudo -H pip2 install twine
- sudo -H pip install twine
- which twine
- mkdir -p wheels
install:
- sudo -H pip2 install -U delocate wheel pip setuptools
- ls -lh
- pip2 install --user -r requirements.txt
install: skip
script:
- pip2 wheel --no-deps .
- delocate-listdeps --all *.whl
- delocate-wheel -v *.whl
- delocate-listdeps --all *.whl
- ls -l *.whl
- rm -f *.dylib
- pip2 install --user -v *.whl
- pwd; mkdir temp; cd temp; pwd
- python -c "import pssh.clients"
- cd ..; pwd
- mv -f *.whl wheels/
- ./ci/travis/pyenv-wheel.sh
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
Expand All @@ -106,52 +91,47 @@ jobs:
python: skip

- <<: *osx-wheels
osx_image: xcode9.2
osx_image: xcode11.3
env:
- PYENV: 3.6.11

- <<: *osx-wheels
osx_image: xcode9.4
osx_image: xcode11.6
env:
- PYENV: 3.7.8

- <<: *osx-wheels
osx_image: xcode8
osx_image: xcode11.3
env:
- PYENV: 3.7.0
install: skip
script:
- ./ci/travis/pyenv-wheel.sh
- PYENV: 3.7.8

- <<: *osx-wheels
osx_image: xcode9.2
osx_image: xcode11.3
env:
- PYENV: 3.7.0
install: skip
script:
- ./ci/travis/pyenv-wheel.sh
- PYENV: 3.8.5

- <<: *osx-wheels
osx_image: xcode9.4
osx_image: xcode11.6
env:
- PYENV: 3.7.0
install: skip
script:
- ./ci/travis/pyenv-wheel.sh
- PYENV: 3.8.5

- os: linux
stage: build packages
env:
- SYSTEM_PACKAGES=1
python: 3.6
before_install: skip
install: skip
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- ./ci/docker/build-packages.sh
deploy:
- provider: releases
skip_cleanup: true
api_key:
secure: hKf+D9ZWRCJWNQtlOWeFh7z1a+VSz+GK5qOY0e1+iV/PrM0f41wy2yej0bxG1zS6CQAnJBK6/gmq5uXXhQhGNQeIQs7zElyKlrijQAn5UstPPJTRIk2oywRr2b+q0k3V42tto6WbhjqPRpOQl/pNTjKJCc/UPgd6kOVZEhCfAec=
file_glob: true
file: '*.{deb,rpm}'
on:
repo: ParallelSSH/parallel-ssh
tags: true
# - os: linux
# stage: build packages
# env:
# - SYSTEM_PACKAGES=1
# python: 3.6
# before_install: skip
# install: skip
# script:
# - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
# - ./ci/docker/build-packages.sh
# deploy:
# - provider: releases
# skip_cleanup: true
# api_key:
# secure: hKf+D9ZWRCJWNQtlOWeFh7z1a+VSz+GK5qOY0e1+iV/PrM0f41wy2yej0bxG1zS6CQAnJBK6/gmq5uXXhQhGNQeIQs7zElyKlrijQAn5UstPPJTRIk2oywRr2b+q0k3V42tto6WbhjqPRpOQl/pNTjKJCc/UPgd6kOVZEhCfAec=
# file_glob: true
# file: '*.{deb,rpm}'
# on:
# repo: ParallelSSH/parallel-ssh
# tags: true
16 changes: 16 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Change Log
============

1.10.0
+++++++

Changes
--------

* Added ``return_list`` optional argument to ``run_command`` to return list of ``HostOutput`` objects as output rather than dictionary - defaults to ``False``. List output will become default starting from ``2.0.0``.
* Updated native clients for new version of ``ssh2-python``.
* Manylinux 2010 wheels.

Fixes
------

* Sockets would not be closed on client going out of scope - #175
* Calling ``join()`` would reset encoding set on ``run_command`` - #159


1.9.1
++++++
Expand Down
4 changes: 2 additions & 2 deletions ci/travis/build-manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker_tag="parallelssh/parallelssh-manylinux"

rm -rf build dist

docker pull quay.io/pypa/manylinux1_x86_64
docker tag quay.io/pypa/manylinux1_x86_64 manylinux
docker pull quay.io/pypa/manylinux2010_x86_64
docker tag quay.io/pypa/manylinux2010_x86_64 manylinux
docker run --rm -v `pwd`:/io manylinux /io/ci/travis/build-wheels.sh
ls wheelhouse/
23 changes: 21 additions & 2 deletions doc/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,33 @@ Please note that the underlying SSH libraries used are subject to change and not

*New in version 1.1.*

Paramiko (current default SSH library)
---------------------------------------
Paramiko based clients (``pssh.clients.miko``)
-----------------------------------------------

.. note::

When using the paramiko based clients, ``parallel-ssh`` makes use of gevent's monkey patching to enable asynchronous use of the Python standard library's network I/O as paramiko does not and cannot natively support non-blocking mode.

Monkey patching is only done for the clients under ``pssh.clients.miko`` and the deprecated imports ``pssh.pssh_client`` and ``pssh.ssh_client``.

Default client imports from ``pssh.clients`` do not do any monkey patching.

Make sure that these imports come **before** any other imports in your code in this case. Otherwise, patching may not be done before the standard library is loaded which will then cause the (g)event loop to be blocked.

If you are seeing messages like ``This operation would block forever``, this is the cause.

Paramiko based clients are deprecated and will be *removed* in the ``2.0.0`` release.


GSS-API Authentication - aka Kerberos
+++++++++++++++++++++++++++++++++++++++

GSS authentication allows logins using Windows LDAP configured user accounts via Kerberos on Linux.

.. code-block:: python
from pssh.clients.miko import ParallelSSHClient
client = ParallelSSHClient(hosts)
client.run_command('id', gss_auth=True, gss_kex=True, gss_host='my_gss_host')
Expand Down
Loading

0 comments on commit d961c42

Please sign in to comment.