diff --git a/changelogs/fragments/paramiko_ssh-improve-error-message.yaml b/changelogs/fragments/paramiko_ssh-improve-error-message.yaml new file mode 100644 index 00000000000..dea10ccd972 --- /dev/null +++ b/changelogs/fragments/paramiko_ssh-improve-error-message.yaml @@ -0,0 +1,2 @@ +bugfixes: + - paramiko_ssh - improve authentication error message so it is less confusing diff --git a/lib/ansible/plugins/connection/paramiko_ssh.py b/lib/ansible/plugins/connection/paramiko_ssh.py index 4f8b903cb38..ce47b74bbc1 100644 --- a/lib/ansible/plugins/connection/paramiko_ssh.py +++ b/lib/ansible/plugins/connection/paramiko_ssh.py @@ -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)