From a8b2b5b0c9250da937b13fa5395a12612d240eff Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 28 Jul 2015 15:47:52 -0400 Subject: [PATCH] avoids printing blank diffs fixes #10147 fixes #9471 --- lib/ansible/plugins/callback/default.py | 2 +- lib/ansible/plugins/callback/minimal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/callback/default.py b/lib/ansible/plugins/callback/default.py index aba83107bea..92cf68a4e0c 100644 --- a/lib/ansible/plugins/callback/default.py +++ b/lib/ansible/plugins/callback/default.py @@ -109,7 +109,7 @@ class CallbackModule(CallbackBase): self._display.banner(msg) def v2_on_file_diff(self, result): - if 'diff' in result._result: + if 'diff' in result._result and result._result['diff'] != {}: self._display.display(self._get_diff(result._result['diff'])) def v2_playbook_item_on_ok(self, result): diff --git a/lib/ansible/plugins/callback/minimal.py b/lib/ansible/plugins/callback/minimal.py index df7f68f7f45..d03a023605e 100644 --- a/lib/ansible/plugins/callback/minimal.py +++ b/lib/ansible/plugins/callback/minimal.py @@ -77,5 +77,5 @@ class CallbackModule(CallbackBase): self._display.display("%s | UNREACHABLE!" % result._host.get_name(), color='yellow') def v2_on_file_diff(self, result): - if 'diff' in result._result: + if 'diff' in result._result and result._result['diff'] != {}: self._display.display(self._get_diff(result._result['diff']))