Paramiko might not come standard everywhere (#54486)

* Paramiko might not come standard everywhere

There is a platform where paramiko isn't shipped but a special version
of paramiko just for our use is shipped.  This code imports paramiko
from that location.
This commit is contained in:
Toshio Kuratomi 2019-04-02 10:06:51 -07:00 committed by GitHub
parent 48c7501768
commit b03c16fa8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 9 deletions

View file

@ -176,7 +176,13 @@ with warnings.catch_warnings():
try:
import paramiko
HAVE_PARAMIKO = True
except (ImportError, AttributeError) as err: # paramiko and gssapi are incompatible and raise AttributeError not ImportError
except ImportError:
try:
import ansible_paramiko as paramiko
HAVE_PARAMIKO = True
except (ImportError, AttributeError) as err: # paramiko and gssapi are incompatible and raise AttributeError not ImportError
PARAMIKO_IMP_ERR = err
except AttributeError as err: # paramiko and gssapi are incompatible and raise AttributeError not ImportError
PARAMIKO_IMP_ERR = err