mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
shell + become fixes
1 less level of shell + quoting simplified become commands, less quote and shell
This commit is contained in:
parent
bc41f46fec
commit
6dc910c13a
4 changed files with 15 additions and 15 deletions
|
@ -507,9 +507,6 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
replacement strategy (python3 could use surrogateescape)
|
||||
'''
|
||||
|
||||
if executable is not None and self._connection.allow_executable:
|
||||
cmd = executable + ' -c ' + pipes.quote(cmd)
|
||||
|
||||
display.debug("_low_level_execute_command(): starting")
|
||||
if not cmd:
|
||||
# this can happen with powershell modules when there is no analog to a Windows command (like chmod)
|
||||
|
@ -522,6 +519,9 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
display.debug("_low_level_execute_command(): using become for this command")
|
||||
cmd = self._play_context.make_become_cmd(cmd, executable=executable)
|
||||
|
||||
if executable is not None and self._connection.allow_executable:
|
||||
cmd = executable + ' -c ' + pipes.quote(cmd)
|
||||
|
||||
display.debug("_low_level_execute_command(): executing: %s" % (cmd,))
|
||||
rc, stdout, stderr = self._connection.exec_command(cmd, in_data=in_data, sudoable=sudoable)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue