Only show diff when the task actually induced a change

This implements solution #1 in the proposal #14860.

It only shows the diff if the task induced a change, which means that if the changed_when control overrides the task, not diff will be produced.
See #14860 for a rationale and the use-case.
pull/14864/head
Dag Wieers 8 years ago
parent 49bb4803b5
commit f5b6f52940

@ -150,11 +150,11 @@ class CallbackModule(CallbackBase):
def v2_on_file_diff(self, result):
if result._task.loop and 'results' in result._result:
for res in result._result['results']:
if 'diff' in res and res['diff']:
if 'diff' in res and res['diff'] and res.get('changed', False):
diff = self._get_diff(res['diff'])
if diff:
self._display.display(diff)
elif 'diff' in result._result and result._result['diff']:
elif 'diff' in result._result and result._result['diff'] and result._result.get('changed', False):
diff = self._get_diff(result._result['diff'])
if diff:
self._display.display(diff)

Loading…
Cancel
Save