Only show a task banner if a diff is found (#55050)

This commit is contained in:
Andrew Gaffney 2019-04-09 12:47:12 -05:00 committed by Brian Coca
parent 6eedc4d075
commit 94154c5f4d

View file

@ -239,18 +239,19 @@ class CallbackModule(CallbackBase):
self._display.banner(msg) self._display.banner(msg)
def v2_on_file_diff(self, result): def v2_on_file_diff(self, result):
if self._last_task_banner != result._task._uuid:
self._print_task_banner(result._task)
if result._task.loop and 'results' in result._result: if result._task.loop and 'results' in result._result:
for res in result._result['results']: for res in result._result['results']:
if 'diff' in res and res['diff'] and res.get('changed', False): if 'diff' in res and res['diff'] and res.get('changed', False):
diff = self._get_diff(res['diff']) diff = self._get_diff(res['diff'])
if diff: if diff:
if self._last_task_banner != result._task._uuid:
self._print_task_banner(result._task)
self._display.display(diff) self._display.display(diff)
elif 'diff' in result._result and result._result['diff'] and result._result.get('changed', False): elif 'diff' in result._result and result._result['diff'] and result._result.get('changed', False):
diff = self._get_diff(result._result['diff']) diff = self._get_diff(result._result['diff'])
if diff: if diff:
if self._last_task_banner != result._task._uuid:
self._print_task_banner(result._task)
self._display.display(diff) self._display.display(diff)
def v2_runner_item_on_ok(self, result): def v2_runner_item_on_ok(self, result):