diff options
author | Toshio Kuratomi <toshio@fedoraproject.org> | 2016-02-08 22:05:46 -0800 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2016-02-08 22:06:38 -0800 |
commit | dcc0a2d5966fa2d05d6e9dff0af0059c5991ce51 (patch) | |
tree | a5ddef134869cff4465f2bdb9b19af4aa60ee3fa | |
parent | c97afd0c48ed27f9b89628b579fbfbc43a8d6c90 (diff) | |
download | ansible-dcc0a2d5966fa2d05d6e9dff0af0059c5991ce51.tar.gz |
Also hide the before state of files with --diff and no_log
-rw-r--r-- | lib/ansible/plugins/action/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index a93e8b41c3..f6a914097c 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -611,7 +611,10 @@ class ActionBase(with_metaclass(ABCMeta, object)): diff['after_header'] = 'dynamically generated' diff['after'] = source - if self._play_context.no_log and 'after' in diff: - diff["after"] = " [[ Diff output has been hidden because 'no_log: true' was specified for this result ]]" + if self._play_context.no_log: + if 'before' in diff: + diff["before"] = "" + if 'after' in diff: + diff["after"] = " [[ Diff output has been hidden because 'no_log: true' was specified for this result ]]" return diff |