From 8e1b422e4a56492fc32c8d3b82abcd3d0023064f 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 (cherry picked from commit f82d95ae288cccae8245236e4d7e6188f0a7d389) --- 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 82a30f11a7..12500a962d 100644 --- a/lib/ansible/plugins/connection/__init__.py +++ b/lib/ansible/plugins/connection/__init__.py @@ -260,6 +260,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]))