Skip to content

Commit

Permalink
Print specific error for BadHostKeyException (ansible#24120)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qalthos authored Apr 28, 2017
1 parent e09cd58 commit f9ec06d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ansible/plugins/connection/paramiko_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ def _connect_uncached(self):
port=port,
**sock_kwarg
)
except paramiko.ssh_exception.BadHostKeyException as e:
raise AnsibleConnectionFailure('host key mismatch for %s' % e.hostname)
except Exception as e:
msg = str(e)
if "PID check failed" in msg:
Expand Down

0 comments on commit f9ec06d

Please sign in to comment.