|
|
|
@ -161,7 +161,7 @@ class TestPlayContext(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
play_context.become_method = 'doas'
|
|
|
|
|
cmd = play_context.make_become_cmd(cmd=default_cmd, executable="/bin/bash")
|
|
|
|
|
self.assertEqual(cmd, """%s -c '%s %s echo %s && %s %s env ANSIBLE=true %s'""" % (default_exe, doas_exe, doas_flags, play_context.success_key, doas_exe, doas_flags, default_cmd))
|
|
|
|
|
self.assertEqual(cmd, """%s -c '%s %s %s -c '"'"'echo %s; %s'"'"''""" % (default_exe, doas_exe, doas_flags, default_exe, play_context.success_key, default_cmd))
|
|
|
|
|
|
|
|
|
|
play_context.become_method = 'bad'
|
|
|
|
|
self.assertRaises(AnsibleError, play_context.make_become_cmd, cmd=default_cmd, executable="/bin/bash")
|
|
|
|
|