1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

When become_method is su, self._play_context.prompt is a function. Fixes #23689

This commit is contained in:
Matt Martz 2017-04-18 11:34:07 -05:00 committed by Brian Coca
parent bf1a543f06
commit f82d95ae28

View file

@ -258,6 +258,8 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
if not b_lines: if not b_lines:
return False return False
return b_lines[-1].strip().endswith(b_prompt) or b_lines[0].strip().endswith(b_prompt) return b_lines[-1].strip().endswith(b_prompt) or b_lines[0].strip().endswith(b_prompt)
else:
return self._play_context.prompt(b_output)
def check_incorrect_password(self, b_output): def check_incorrect_password(self, b_output):
b_incorrect_password = to_bytes(gettext.dgettext(self._play_context.become_method, C.BECOME_ERROR_STRINGS[self._play_context.become_method])) b_incorrect_password = to_bytes(gettext.dgettext(self._play_context.become_method, C.BECOME_ERROR_STRINGS[self._play_context.become_method]))