From d76298b5d38b438444879dd10e34f86dd676d271 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 26 Apr 2018 12:18:17 -0400 Subject: [PATCH] call diff callback also when task diff is true (#39366) fixes #31129 --- lib/ansible/plugins/strategy/__init__.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/ansible/plugins/strategy/__init__.py b/lib/ansible/plugins/strategy/__init__.py index 4099d8d963..e8f6a75edf 100644 --- a/lib/ansible/plugins/strategy/__init__.py +++ b/lib/ansible/plugins/strategy/__init__.py @@ -439,12 +439,6 @@ class StrategyBase: task_result._host = original_host task_result._task = original_task - # get the correct loop var for use later - if original_task.loop_control: - loop_var = original_task.loop_control.loop_var - else: - loop_var = 'item' - # send callbacks for 'non final' results if '_ansible_retry' in task_result._result: self._tqm.send_callback('v2_runner_retry', task_result) @@ -456,7 +450,7 @@ class StrategyBase: self._tqm.send_callback('v2_runner_item_on_skipped', task_result) else: if 'diff' in task_result._result: - if self._diff: + if self._diff or getattr(original_task, 'diff', False): self._tqm.send_callback('v2_on_file_diff', task_result) self._tqm.send_callback('v2_runner_item_on_ok', task_result) continue @@ -630,7 +624,7 @@ class StrategyBase: self._tqm._stats.set_custom_stats(k, data[k], myhost) if 'diff' in task_result._result: - if self._diff: + if self._diff or getattr(original_task, 'diff', False): self._tqm.send_callback('v2_on_file_diff', task_result) if not isinstance(original_task, TaskInclude):