mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Remove tmp as a parameter to the connection plugins
There doesn't appear to be anything that actually uses tmp_path in the connection plugins so we don't need to pass that in to exec_command. That change also means that we don't need to pass tmp_path around in many places in the action plugins any more. there may be more cleanup that can be done there as well (the action plugin's public run() method takes tmp as a keyword arg but that may not be necessary). As a sideeffect of this patch, some potential problems with chmod and the patch, assemble, copy, and template modules has been fixed (those modules called _remote_chmod() with the wrong order for their parameters. Removing the tmp parameter fixed them.)
This commit is contained in:
parent
95b371dd60
commit
a1428d6bed
24 changed files with 81 additions and 73 deletions
|
@ -122,8 +122,17 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
|
|||
|
||||
@ensure_connect
|
||||
@abstractmethod
|
||||
def exec_command(self, cmd, tmp_path, in_data=None, executable=None, sudoable=True):
|
||||
"""Run a command on the remote host
|
||||
def exec_command(self, cmd, in_data=None, sudoable=True):
|
||||
"""Run a command on the remote host.
|
||||
|
||||
:arg cmd: byte string containing the command
|
||||
:kwarg in_data: If set, this data is passed to the command's stdin.
|
||||
This is used to implement pipelining. Currently not all
|
||||
connection plugins implement pipelining.
|
||||
:kwarg sudoable: Tell the connection plugin if we're executing
|
||||
a command via a privilege escalation mechanism. This may affect
|
||||
how the connection plugin returns data. Note that not all
|
||||
connections can handle privilege escalation.
|
||||
|
||||
:returns: a tuple of (return code, stdout, stderr) The return code is
|
||||
an int while stdout and stderr are both byte strings.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue