2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-17 02:58:51 +00:00

Support pre-cryptography paramiko

Older paraiko may be in use that does
not have cryptography requirement, address
error by only conditionally checking cryptography.
This commit is contained in:
Jarrod Johnson 2019-02-08 14:42:53 -05:00
parent bfe55e276d
commit 73b234d29e

View File

@ -22,7 +22,11 @@
import confluent.exceptions as cexc
import confluent.interface.console as conapi
import confluent.log as log
import cryptography
try:
import cryptography
except ImportError:
# Using older, non-crypography based paramiko
cryptography = None
import eventlet
import hashlib
@ -30,7 +34,7 @@ import sys
sys.modules['gssapi'] = None
paramiko = eventlet.import_patched('paramiko')
warnhostkey = False
if cryptography.__version__.split('.') < ['1', '5']:
if cryptography and cryptography.__version__.split('.') < ['1', '5']:
# older cryptography with paramiko breaks most key support except
# ed25519
warnhostkey = True