Change the raw module's detection of environment settings. (#15535)

The task_vars datastructure always contains an environment key,
so use the _task.environment property to look for a non-empty
list instead.
This commit is contained in:
jctanner 2016-04-21 22:58:07 -04:00 committed by Brian Coca
parent a6e83599d6
commit 76f73dc81f

View file

@ -26,11 +26,9 @@ class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None):
if task_vars is None:
task_vars = dict()
else:
if 'vars' in task_vars:
if 'environment' in task_vars['vars']:
# The environment key only exists if explicitly declared in the task or in the play
self._display.warning('raw module does not support the environment keyword')
if self._task.environment:
self._display.warning('raw module does not support the environment keyword')
result = super(ActionModule, self).run(tmp, task_vars)