Re-add support for setting shell from play context (#52139)

* Re-add support for setting shell from play context

* Add integration tests

* Add more tests for shell override

* fix sanity issue
This commit is contained in:
Jordan Borean 2019-02-14 03:49:13 +10:00 committed by Matt Martz
parent b34d141eed
commit 847d089d6b
6 changed files with 151 additions and 1 deletions

View file

@ -83,7 +83,8 @@ class ConnectionBase(AnsiblePlugin):
# we always must have shell
if not self._shell:
self._shell = get_shell_plugin(shell_type=getattr(self, '_shell_type', None), executable=self._play_context.executable)
shell_type = play_context.shell if play_context.shell else getattr(self, '_shell_type', None)
self._shell = get_shell_plugin(shell_type=shell_type, executable=self._play_context.executable)
self.become = None