ansible: patch to fix prompt for become-method=su
This commit is contained in:
parent
fdc192e90f
commit
5aa46abfec
|
@ -0,0 +1,21 @@
|
||||||
|
From 0dd0600a6be610a6eeec68332e10e18fb1560304 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matt Martz <matt@sivel.net>
|
||||||
|
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]))
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'ansible'
|
# Template file for 'ansible'
|
||||||
pkgname=ansible
|
pkgname=ansible
|
||||||
version=2.3.0.0
|
version=2.3.0.0
|
||||||
revision=1
|
revision=2
|
||||||
noarch=yes
|
noarch=yes
|
||||||
build_style=python2-module
|
build_style=python2-module
|
||||||
hostmakedepends="python-setuptools"
|
hostmakedepends="python-setuptools"
|
||||||
|
|
Loading…
Reference in New Issue