From 4be20ff3db15380ec6aa99fe53672e636aad2c5d Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Tue, 3 May 2016 14:30:52 -0500 Subject: [PATCH] Updating SSHV2 client for paramiko 2.0.0 issue #104 This PR updates the SSHV2 client to have the fix the issue outlined in https://github.com/paramiko/paramiko/issues/735#issuecomment-216083986 where a new library added by paramiko 2.0.0 (cryptography) causes a threadlocking issue where the SSHV2 client is unable to function when connecting on import or through the unittest runner. This PR should not affect any functionality users may have but may affect users who have not yet installed the cryptography library. To install the correct cryptography library it is recommended to upgrade paramiko using `pip install --upgrade paramiko` Change-Id: Iabcce8a66b5958b117c45977708cab777dc90a39 --- cafe/plugins/sshv2/cafe/engine/sshv2/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cafe/plugins/sshv2/cafe/engine/sshv2/client.py b/cafe/plugins/sshv2/cafe/engine/sshv2/client.py index 36ffbf7..3d6cdb8 100644 --- a/cafe/plugins/sshv2/cafe/engine/sshv2/client.py +++ b/cafe/plugins/sshv2/cafe/engine/sshv2/client.py @@ -29,6 +29,10 @@ from cafe.engine.sshv2.models import ExecResponse # which causes a deadlock. https://github.com/paramiko/paramiko/issues/104 py3compat.u("") +# dirty hack 2.0 also issue 104 +from cryptography.hazmat.backends import default_backend +default_backend() + class ProxyTypes(object): SOCKS5 = 2