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.
pull/15485/head
jctanner 9 years ago committed by Brian Coca
parent a6e83599d6
commit 76f73dc81f

@ -26,10 +26,8 @@ class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None): def run(self, tmp=None, task_vars=None):
if task_vars is None: if task_vars is None:
task_vars = dict() task_vars = dict()
else:
if 'vars' in task_vars: if self._task.environment:
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') self._display.warning('raw module does not support the environment keyword')
result = super(ActionModule, self).run(tmp, task_vars) result = super(ActionModule, self).run(tmp, task_vars)

Loading…
Cancel
Save