Skip to content

Commit d961c42

Browse files
authored
New output (#201)
* 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.
1 parent 8b7bb4b commit d961c42

19 files changed

+654
-322
lines changed

.appveyor.yml

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,67 +10,25 @@ environment:
1010
PYPI_PASS:
1111
secure: x+dF0A8BZUf2IrPNRN1O0w==
1212
matrix:
13-
- PYTHON: "C:\\Python27"
14-
PYTHON_VERSION: "2.7"
15-
PYTHON_ARCH: "32"
16-
MSVC: "Visual Studio 9"
17-
ARCH: i386
18-
19-
- PYTHON: "C:\\Python27-x64"
20-
PYTHON_VERSION: "2.7"
21-
PYTHON_ARCH: "64"
22-
MSVC: "Visual Studio 9"
23-
ARCH: x64_86
24-
25-
- PYTHON: "C:\\Python34"
26-
PYTHON_VERSION: "3.4"
27-
PYTHON_ARCH: "32"
28-
MSVC: "Visual Studio 10"
29-
ARCH: i386
30-
31-
- PYTHON: "C:\\Python34-x64"
32-
PYTHON_VERSION: "3.4"
33-
PYTHON_ARCH: "64"
34-
MSVC: "Visual Studio 10 Win64"
35-
ARCH: x64_86
36-
37-
- PYTHON: "C:\\Python35"
38-
PYTHON_VERSION: "3.5"
39-
PYTHON_ARCH: "32"
40-
MSVC: "Visual Studio 14"
41-
ARCH: i386
42-
43-
- PYTHON: "C:\\Python35-x64"
44-
PYTHON_VERSION: "3.5"
45-
PYTHON_ARCH: "64"
46-
MSVC: "Visual Studio 14 Win64"
47-
ARCH: x64_86
48-
49-
- PYTHON: "C:\\Python36"
50-
PYTHON_VERSION: "3.6"
51-
PYTHON_ARCH: "32"
52-
MSVC: "Visual Studio 14"
53-
ARCH: i386
54-
5513
- PYTHON: "C:\\Python36-x64"
5614
PYTHON_VERSION: "3.6"
5715
PYTHON_ARCH: "64"
5816
MSVC: "Visual Studio 14 Win64"
5917
ARCH: x64_86
6018

61-
# No gevent 3.7 32-bit wheel available, source build fails.
62-
# - PYTHON: "C:\\Python37"
63-
# PYTHON_VERSION: "3.7"
64-
# PYTHON_ARCH: "32"
65-
# MSVC: "Visual Studio 14"
66-
# ARCH: i386
67-
6819
- PYTHON: "C:\\Python37-x64"
6920
PYTHON_VERSION: "3.7"
7021
PYTHON_ARCH: "64"
7122
MSVC: "Visual Studio 14 Win64"
7223
ARCH: x64_86
7324

25+
- PYTHON: "C:\\Python38-x64"
26+
PYTHON_VERSION: "3.8"
27+
PYTHON_ARCH: "64"
28+
MSVC: "Visual Studio 14 Win64"
29+
ARCH: x64_86
30+
31+
7432
install:
7533
# If there is a newer build queued for the same PR, cancel this one.
7634
# The AppVeyor 'rollout builds' option is supposed to serve the same

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*~
22
*.py[cod]
3+
.idea
34

45
# C extensions
56
*.so
@@ -34,3 +35,12 @@ nosetests.xml
3435
.mr.developer.cfg
3536
.project
3637
.pydevproject
38+
39+
# Virtual Environments
40+
env
41+
env_2
42+
env_3
43+
pypy
44+
45+
# Documentation builds
46+
doc/_build

.travis.yml

Lines changed: 44 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ cache:
33
- pip
44
- directories:
55
- "$HOME/.pyenv"
6+
- "$HOME/Library/Caches/Homebrew"
7+
- "$HOME/.git/lfs"
68
notifications:
79
email: false
810
services:
911
- docker
1012
python:
1113
- 2.7
12-
- 3.4
13-
- 3.5
1414
- 3.6
15+
- 3.7
16+
- 3.8
1517
addons:
1618
apt:
1719
packages:
@@ -22,13 +24,13 @@ addons:
2224
before_install:
2325
- pip install -U pip setuptools
2426
install:
25-
- pip install -r requirements_dev.txt
27+
- pip install -U -r requirements_dev.txt
2628
script:
2729
# For testing SSH agent related functionality
2830
- eval `ssh-agent -s`
29-
- nosetests --with-coverage --cover-package=pssh --nologcapture tests/test_native_tunnel.py
30-
- nosetests --with-coverage --cover-package=pssh tests/test_native_*_client.py
31-
- nosetests --with-coverage --cover-package=pssh tests/test_paramiko*.py
31+
- pytest --reruns 5 --cov-append --cov=pssh -s tests/test_native_tunnel.py
32+
- pytest --reruns 5 --cov-append --cov=pssh -s tests/test_native_*_client.py
33+
- pytest --reruns 5 --cov-append --cov=pssh -s tests/test_paramiko*.py
3234
- flake8 pssh
3335
- cd doc; make html; cd ..
3436
# Test building from source distribution
@@ -71,32 +73,15 @@ jobs:
7173
- &osx-wheels
7274
stage: build packages
7375
os: osx
74-
osx_image: xcode8
76+
osx_image: xcode11.6
7577
env:
76-
- PYENV: 3.6.4
78+
- PYENV: 3.6.11
7779
before_install:
78-
- brew update
79-
- brew link --overwrite python@2 || brew install python@2 || brew link --overwrite python@2
80-
- which python2
81-
- sudo -H pip2 install twine
80+
- sudo -H pip install twine
8281
- which twine
8382
- mkdir -p wheels
84-
install:
85-
- sudo -H pip2 install -U delocate wheel pip setuptools
86-
- ls -lh
87-
- pip2 install --user -r requirements.txt
83+
install: skip
8884
script:
89-
- pip2 wheel --no-deps .
90-
- delocate-listdeps --all *.whl
91-
- delocate-wheel -v *.whl
92-
- delocate-listdeps --all *.whl
93-
- ls -l *.whl
94-
- rm -f *.dylib
95-
- pip2 install --user -v *.whl
96-
- pwd; mkdir temp; cd temp; pwd
97-
- python -c "import pssh.clients"
98-
- cd ..; pwd
99-
- mv -f *.whl wheels/
10085
- ./ci/travis/pyenv-wheel.sh
10186
after_success:
10287
- if [[ ! -z "$TRAVIS_TAG" ]]; then
@@ -106,52 +91,47 @@ jobs:
10691
python: skip
10792

10893
- <<: *osx-wheels
109-
osx_image: xcode9.2
94+
osx_image: xcode11.3
95+
env:
96+
- PYENV: 3.6.11
11097

11198
- <<: *osx-wheels
112-
osx_image: xcode9.4
99+
osx_image: xcode11.6
100+
env:
101+
- PYENV: 3.7.8
113102

114103
- <<: *osx-wheels
115-
osx_image: xcode8
104+
osx_image: xcode11.3
116105
env:
117-
- PYENV: 3.7.0
118-
install: skip
119-
script:
120-
- ./ci/travis/pyenv-wheel.sh
106+
- PYENV: 3.7.8
121107

122108
- <<: *osx-wheels
123-
osx_image: xcode9.2
109+
osx_image: xcode11.3
124110
env:
125-
- PYENV: 3.7.0
126-
install: skip
127-
script:
128-
- ./ci/travis/pyenv-wheel.sh
111+
- PYENV: 3.8.5
129112

130113
- <<: *osx-wheels
131-
osx_image: xcode9.4
114+
osx_image: xcode11.6
132115
env:
133-
- PYENV: 3.7.0
134-
install: skip
135-
script:
136-
- ./ci/travis/pyenv-wheel.sh
116+
- PYENV: 3.8.5
137117

138-
- os: linux
139-
stage: build packages
140-
env:
141-
- SYSTEM_PACKAGES=1
142-
python: 3.6
143-
before_install: skip
144-
install: skip
145-
script:
146-
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
147-
- ./ci/docker/build-packages.sh
148-
deploy:
149-
- provider: releases
150-
skip_cleanup: true
151-
api_key:
152-
secure: hKf+D9ZWRCJWNQtlOWeFh7z1a+VSz+GK5qOY0e1+iV/PrM0f41wy2yej0bxG1zS6CQAnJBK6/gmq5uXXhQhGNQeIQs7zElyKlrijQAn5UstPPJTRIk2oywRr2b+q0k3V42tto6WbhjqPRpOQl/pNTjKJCc/UPgd6kOVZEhCfAec=
153-
file_glob: true
154-
file: '*.{deb,rpm}'
155-
on:
156-
repo: ParallelSSH/parallel-ssh
157-
tags: true
118+
# - os: linux
119+
# stage: build packages
120+
# env:
121+
# - SYSTEM_PACKAGES=1
122+
# python: 3.6
123+
# before_install: skip
124+
# install: skip
125+
# script:
126+
# - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
127+
# - ./ci/docker/build-packages.sh
128+
# deploy:
129+
# - provider: releases
130+
# skip_cleanup: true
131+
# api_key:
132+
# secure: hKf+D9ZWRCJWNQtlOWeFh7z1a+VSz+GK5qOY0e1+iV/PrM0f41wy2yej0bxG1zS6CQAnJBK6/gmq5uXXhQhGNQeIQs7zElyKlrijQAn5UstPPJTRIk2oywRr2b+q0k3V42tto6WbhjqPRpOQl/pNTjKJCc/UPgd6kOVZEhCfAec=
133+
# file_glob: true
134+
# file: '*.{deb,rpm}'
135+
# on:
136+
# repo: ParallelSSH/parallel-ssh
137+
# tags: true

Changelog.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Change Log
22
============
33

4+
1.10.0
5+
+++++++
6+
7+
Changes
8+
--------
9+
10+
* 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``.
11+
* Updated native clients for new version of ``ssh2-python``.
12+
* Manylinux 2010 wheels.
13+
14+
Fixes
15+
------
16+
17+
* Sockets would not be closed on client going out of scope - #175
18+
* Calling ``join()`` would reset encoding set on ``run_command`` - #159
19+
420

521
1.9.1
622
++++++

ci/travis/build-manylinux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ docker_tag="parallelssh/parallelssh-manylinux"
44

55
rm -rf build dist
66

7-
docker pull quay.io/pypa/manylinux1_x86_64
8-
docker tag quay.io/pypa/manylinux1_x86_64 manylinux
7+
docker pull quay.io/pypa/manylinux2010_x86_64
8+
docker tag quay.io/pypa/manylinux2010_x86_64 manylinux
99
docker run --rm -v `pwd`:/io manylinux /io/ci/travis/build-wheels.sh
1010
ls wheelhouse/

doc/advanced.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,33 @@ Please note that the underlying SSH libraries used are subject to change and not
550550

551551
*New in version 1.1.*
552552

553-
Paramiko (current default SSH library)
554-
---------------------------------------
553+
Paramiko based clients (``pssh.clients.miko``)
554+
-----------------------------------------------
555+
556+
.. note::
557+
558+
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.
559+
560+
Monkey patching is only done for the clients under ``pssh.clients.miko`` and the deprecated imports ``pssh.pssh_client`` and ``pssh.ssh_client``.
561+
562+
Default client imports from ``pssh.clients`` do not do any monkey patching.
563+
564+
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.
565+
566+
If you are seeing messages like ``This operation would block forever``, this is the cause.
567+
568+
Paramiko based clients are deprecated and will be *removed* in the ``2.0.0`` release.
569+
555570

556571
GSS-API Authentication - aka Kerberos
557572
+++++++++++++++++++++++++++++++++++++++
558573

574+
GSS authentication allows logins using Windows LDAP configured user accounts via Kerberos on Linux.
575+
559576
.. code-block:: python
560577
578+
from pssh.clients.miko import ParallelSSHClient
579+
561580
client = ParallelSSHClient(hosts)
562581
563582
client.run_command('id', gss_auth=True, gss_kex=True, gss_host='my_gss_host')

0 commit comments

Comments
 (0)