corrected changed_when handling

pull/14899/head
Brian Coca 9 years ago
parent f7dc7e3aab
commit 928a0863c2

@ -447,12 +447,10 @@ class TaskExecutor:
# helper methods for use below in evaluating changed/failed_when # helper methods for use below in evaluating changed/failed_when
def _evaluate_changed_when_result(result): def _evaluate_changed_when_result(result):
if self._task.changed_when: if self._task.changed_when is not None and self._task.changed_when:
cond = Conditional(loader=self._loader) cond = Conditional(loader=self._loader)
cond.when = self._task.changed_when cond.when = self._task.changed_when
result['changed'] = cond.evaluate_conditional(templar, vars_copy) result['changed'] = cond.evaluate_conditional(templar, vars_copy)
else:
result['changed'] = False
def _evaluate_failed_when_result(result): def _evaluate_failed_when_result(result):
if self._task.failed_when: if self._task.failed_when:

Loading…
Cancel
Save