From 6fcfebd21d78212ad80d621ba0fdc61d0c057a28 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 7 Aug 2015 16:21:02 -0400 Subject: [PATCH] made sure we need becoem before we format the command, added debug entry also --- lib/ansible/plugins/action/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 729fb07ed1..8f664899f9 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -454,7 +454,8 @@ class ActionBase: self._display.debug("no command, exiting _low_level_execute_command()") return dict(stdout='', stderr='') - if sudoable: + if sudoable and self._play_context.become: + self._display.debug("using become for this command") cmd = self._play_context.make_become_cmd(cmd, executable=executable) self._display.debug("executing the command %s through the connection" % cmd)