fixed executable for raw module
This commit is contained in:
parent
c4b6d91275
commit
24b830bbc8
1 changed files with 4 additions and 8 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue