Ignore BadHostKeyException while trying ssh keys

New version of paramiko uses BadHostKeyException as error when smth wrong
with keys from known_hosts and current public key.

Change-Id: I3ea9a1953b4e6daf33265600681c85cd2cd28828
Closes-bug:1697690
This commit is contained in:
Vladimir Khlyunev 2017-06-14 16:10:08 +04:00 committed by Dennis Dmitriev
parent 65d348c750
commit 3cb41214b5
1 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,8 @@ class SSHAuth(object):
'Unexpected PasswordRequiredException, '
'when password is set!')
raise
except paramiko.AuthenticationException:
except (paramiko.AuthenticationException,
paramiko.BadHostKeyException):
continue
msg = 'Connection using stored authentication info failed!'
if log: