diff options
author | Sam Doran <sdoran@redhat.com> | 2019-01-23 11:32:25 -0500 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2019-01-23 11:32:25 -0500 |
commit | 9d4c0dc1116f0bbd01bac6580a61dc28e314eec4 (patch) | |
tree | 47934e038bc3f8c34bf5440129460832195df13f /lib/ansible/errors | |
parent | 2798d5bafc1e3928018e86d9522c215e5681df95 (diff) | |
download | ansible-9d4c0dc1116f0bbd01bac6580a61dc28e314eec4.tar.gz |
Catch sshpass authentication errors and don't retry multiple times to prevent account lockout (#50776)
* Catch SSH authentication errors and don't retry multiple times to prevent account lock out
Signed-off-by: Sam Doran <sdoran@redhat.com>
* Subclass AnsibleAuthenticationFailure from AnsibleConnectionFailure
Use comparison rather than range() because it's much more efficient.
Signed-off-by: Sam Doran <sdoran@redhat.com>
* Add tests
Signed-off-by: Sam Doran <sdoran@redhat.com>
* Make paramiko_ssh connection plugin behave the same way
Signed-off-by: Sam Doran <sdoran@redhat.com>
* Add changelog
Signed-off-by: Sam Doran <sdoran@redhat.com>
Diffstat (limited to 'lib/ansible/errors')
-rw-r--r-- | lib/ansible/errors/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ansible/errors/__init__.py b/lib/ansible/errors/__init__.py index 35ceaf4949..d165720f86 100644 --- a/lib/ansible/errors/__init__.py +++ b/lib/ansible/errors/__init__.py @@ -219,6 +219,11 @@ class AnsibleConnectionFailure(AnsibleRuntimeError): pass +class AnsibleAuthenticationFailure(AnsibleConnectionFailure): + '''invalid username/password/key''' + pass + + class AnsibleCallbackError(AnsibleRuntimeError): ''' a callback failure ''' pass |