mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
add ansible_executable inventory var
also handle the overrides appropriately also new executable to set shell type
This commit is contained in:
parent
14dfad730e
commit
db61e9be0c
6 changed files with 29 additions and 10 deletions
|
@ -617,8 +617,8 @@ class TestActionBase(unittest.TestCase):
|
|||
play_context.make_become_cmd.assert_not_called()
|
||||
|
||||
play_context.remote_user = 'apo'
|
||||
action_base._low_level_execute_command('ECHO', sudoable=True)
|
||||
play_context.make_become_cmd.assert_called_once_with("ECHO", executable='/bin/sh')
|
||||
action_base._low_level_execute_command('ECHO', sudoable=True, executable='/bin/csh')
|
||||
play_context.make_become_cmd.assert_called_once_with("ECHO", executable='/bin/csh')
|
||||
|
||||
play_context.make_become_cmd.reset_mock()
|
||||
|
||||
|
@ -627,6 +627,6 @@ class TestActionBase(unittest.TestCase):
|
|||
try:
|
||||
play_context.remote_user = 'root'
|
||||
action_base._low_level_execute_command('ECHO SAME', sudoable=True)
|
||||
play_context.make_become_cmd.assert_called_once_with("ECHO SAME", executable='/bin/sh')
|
||||
play_context.make_become_cmd.assert_called_once_with("ECHO SAME", executable=None)
|
||||
finally:
|
||||
C.BECOME_ALLOW_SAME_USER = become_allow_same_user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue