From 0fcd53e887eb69abe177358a5558a80340197f73 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Fri, 24 Jul 2015 11:36:51 -0400 Subject: [PATCH] Make sure the command is sudoable before checking for the become password Fixes #11714 --- lib/ansible/plugins/connections/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/connections/local.py b/lib/ansible/plugins/connections/local.py index fc0cb60229c..e4eddbd4cba 100644 --- a/lib/ansible/plugins/connections/local.py +++ b/lib/ansible/plugins/connections/local.py @@ -70,7 +70,7 @@ class Connection(ConnectionBase): ) self._display.debug("done running command with Popen()") - if self._play_context.prompt and self._play_context.become_pass: + if self._play_context.prompt and self._play_context.become_pass and sudoable: fcntl.fcntl(p.stdout, fcntl.F_SETFL, fcntl.fcntl(p.stdout, fcntl.F_GETFL) | os.O_NONBLOCK) fcntl.fcntl(p.stderr, fcntl.F_SETFL, fcntl.fcntl(p.stderr, fcntl.F_GETFL) | os.O_NONBLOCK) become_output = ''