issue #587: consistent become_exe() behaviour for older Ansibles.
This commit is contained in:
parent
a25fa566a1
commit
92b4724010
|
@ -378,7 +378,15 @@ class PlayContextSpec(Spec):
|
|||
]
|
||||
|
||||
def become_exe(self):
|
||||
return self._play_context.become_exe
|
||||
# In Ansible 2.8, PlayContext.become_exe always has a default value due
|
||||
# to the new options mechanism. Previously it was only set if a value
|
||||
# ("somewhere") had been specified for the task.
|
||||
# For consistency in the tests, here we make older Ansibles behave like
|
||||
# newer Ansibles.
|
||||
exe = self._play_context.become_exe
|
||||
if exe is None and self._play_context.become_method == 'sudo':
|
||||
exe = 'sudo'
|
||||
return exe
|
||||
|
||||
def sudo_args(self):
|
||||
return [
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
'remote_name': null,
|
||||
'password': null,
|
||||
'username': 'root',
|
||||
'sudo_path': null,
|
||||
'sudo_path': 'sudo',
|
||||
'sudo_args': ['-H', '-S', '-n'],
|
||||
},
|
||||
'method': 'sudo',
|
||||
|
|
Loading…
Reference in New Issue