mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-01 13:59:09 -07:00
Rearranging some become stuff in relation to action/connection plugins
Moving the make_sudo_cmd() calls back up to the action level so that connection plugins don't have to know about it at all, and moving some of the become data (prompt and success_key) into the ConnectionInformation object so they don't need to be passed around needlessly.
This commit is contained in:
parent
7a9b5b6fe8
commit
1c185b68be
6 changed files with 25 additions and 20 deletions
|
@ -429,6 +429,10 @@ class ActionBase:
|
|||
debug("no command, exiting _low_level_execute_command()")
|
||||
return dict(stdout='', stderr='')
|
||||
|
||||
print("in _low_level_execute_command, executable is: %s" % executable)
|
||||
if sudoable:
|
||||
cmd = self._connection_info.make_become_cmd(cmd, executable=executable)
|
||||
|
||||
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…
Add table
Add a link
Reference in a new issue