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:
parent
35c415de98
commit
d5fbe6573b
2 changed files with 3 additions and 1 deletions
|
@ -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…
Reference in a new issue