From f82d95ae288cccae8245236e4d7e6188f0a7d389 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 18 Apr 2017 11:34:07 -0500 Subject: [PATCH] When become_method is su, self._play_context.prompt is a function. Fixes #23689 --- lib/ansible/plugins/connection/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/plugins/connection/__init__.py b/lib/ansible/plugins/connection/__init__.py index 8a94d6ed91..6ba4aa2fa6 100644 --- a/lib/ansible/plugins/connection/__init__.py +++ b/lib/ansible/plugins/connection/__init__.py @@ -258,6 +258,8 @@ class ConnectionBase(with_metaclass(ABCMeta, object)): if not b_lines: return False 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): b_incorrect_password = to_bytes(gettext.dgettext(self._play_context.become_method, C.BECOME_ERROR_STRINGS[self._play_context.become_method]))