paramiko_ssh - Improve authentication error message (#64157)

The error is not always an invalid username/password. It could be a connection timeout or refusal.
pull/64167/head
Sam Doran 5 years ago committed by GitHub
parent 35c415de98
commit d5fbe6573b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- paramiko_ssh - improve authentication error message so it is less confusing

@ -354,7 +354,7 @@ class Connection(ConnectionBase):
except paramiko.ssh_exception.BadHostKeyException as e:
raise AnsibleConnectionFailure('host key mismatch for %s' % e.hostname)
except paramiko.ssh_exception.AuthenticationException as e:
msg = 'Invalid/incorrect username/password. {0}'.format(to_text(e))
msg = 'Failed to authenticate: {0}'.format(to_text(e))
raise AnsibleAuthenticationFailure(msg)
except Exception as e:
msg = to_text(e)

Loading…
Cancel
Save