Print specific error for BadHostKeyException (#24120)

pull/4420/head
Nathaniel Case 2017-04-28 13:57:32 -04:00 committed by GitHub
parent e09cd58a17
commit f9ec06d1dc
1 changed files with 2 additions and 0 deletions

View File

@ -245,6 +245,8 @@ class Connection(ConnectionBase):
port=port, port=port,
**sock_kwarg **sock_kwarg
) )
except paramiko.ssh_exception.BadHostKeyException as e:
raise AnsibleConnectionFailure('host key mismatch for %s' % e.hostname)
except Exception as e: except Exception as e:
msg = str(e) msg = str(e)
if "PID check failed" in msg: if "PID check failed" in msg: