add ansible_executable inventory var

also handle the overrides appropriately
also new executable to set shell type
This commit is contained in:
Brian Coca 2016-03-11 20:38:38 -05:00
parent 14dfad730e
commit db61e9be0c
6 changed files with 29 additions and 10 deletions

View file

@ -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