From 24b830bbc8f228015841bc20ba423af6f04129a0 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 13 Jul 2015 16:23:14 -0400 Subject: [PATCH] fixed executable for raw module --- lib/ansible/plugins/action/__init__.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 83f0f4765ca..02f30d4b597 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -412,26 +412,22 @@ class ActionBase: debug("done with _execute_module (%s, %s)" % (module_name, module_args)) return data - def _low_level_execute_command(self, cmd, tmp, sudoable=True, in_data=None): + def _low_level_execute_command(self, cmd, tmp, sudoable=True, in_data=None, executable=None): ''' This is the function which executes the low level shell command, which may be commands to create/remove directories for temporary files, or to run the module code or python directly when pipelining. ''' + if executable is not None: + cmd = executable + ' -c ' + cmd + debug("in _low_level_execute_command() (%s)" % (cmd,)) if not cmd: # this can happen with powershell modules when there is no analog to a Windows command (like chmod) debug("no command, exiting _low_level_execute_command()") return dict(stdout='', stderr='') - #FIXME: disabled as this should happen in the connection plugin, verify before removing - #prompt = None - #success_key = None - # - #if sudoable: - # cmd, prompt, success_key = self._connection_info.make_become_cmd(cmd) - debug("executing the command %s through the connection" % cmd) rc, stdin, stdout, stderr = self._connection.exec_command(cmd, tmp, in_data=in_data, sudoable=sudoable) debug("command execution done")