From 5aa46abfec77f14dc9e88dd7cc4b9777b49a6f39 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Sun, 7 May 2017 16:23:43 +0200 Subject: [PATCH] ansible: patch to fix prompt for become-method=su --- srcpkgs/ansible/patches/23710.patch | 21 +++++++++++++++++++++ srcpkgs/ansible/template | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/ansible/patches/23710.patch diff --git a/srcpkgs/ansible/patches/23710.patch b/srcpkgs/ansible/patches/23710.patch new file mode 100644 index 00000000000..2d5d72798c7 --- /dev/null +++ b/srcpkgs/ansible/patches/23710.patch @@ -0,0 +1,21 @@ +From 0dd0600a6be610a6eeec68332e10e18fb1560304 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(+) + +--- lib/ansible/plugins/connection/__init__.py.orig ++++ lib/ansible/plugins/connection/__init__.py +@@ -258,6 +258,8 @@ def check_password_prompt(self, b_output): + 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])) diff --git a/srcpkgs/ansible/template b/srcpkgs/ansible/template index 6920a2348f5..ef8361cb1f9 100644 --- a/srcpkgs/ansible/template +++ b/srcpkgs/ansible/template @@ -1,7 +1,7 @@ # Template file for 'ansible' pkgname=ansible version=2.3.0.0 -revision=1 +revision=2 noarch=yes build_style=python2-module hostmakedepends="python-setuptools"