paramiko_ssh - Improve authentication error message (#64157)
The error is not always an invalid username/password. It could be a connection timeout or refusal.
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user