mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
centralized bad password handling, fixed outputing of become method
This commit is contained in:
parent
b89071e485
commit
1ce1c52f6f
2 changed files with 5 additions and 7 deletions
|
@ -130,5 +130,6 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
|
|||
|
||||
def check_incorrect_password(self, output, prompt):
|
||||
incorrect_password = gettext.dgettext(self._connection_info.become_method, C.BECOME_ERROR_STRINGS[self._connection_info.become_method])
|
||||
return output.endswith(incorrect_password)
|
||||
if output.endswith(incorrect_password):
|
||||
raise AnsibleError('Incorrect %s password' % self._connection_info.become_method)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue