changed verbose_override to the new _ansible_verbose_override to keep in line with previous changes

output now defaults back to having indent=4
This commit is contained in:
Brian Coca
2015-07-27 22:15:44 -04:00
parent 8746e692c1
commit 5f8db9cd4b
5 changed files with 15 additions and 18 deletions

View File

@@ -50,20 +50,17 @@ class CallbackBase:
version = getattr(self, 'CALLBACK_VERSION', '1.0')
self._display.vvvv('Loaded callback %s of type %s, v%s' % (name, ctype, version))
def _dump_results(self, result, indent=None, sort_keys=True):
def _dump_results(self, result, indent=4, sort_keys=True):
if result.get('_ansible_no_log', False):
return json.dumps(dict(censored="the output has been hidden due to the fact that 'no_log: true' was specified for this result"))
else:
if '_ansible_verbose_always' in result:
indent = 4
# all result keys stating with _ansible_ are internal, so remove
# them from the result before we output anything. We have to save
# the keys off first, as we're modifying the dict (so iteritems()
# won't work here)
for k in result.keys():
if isinstance(k, string_types) and k.startswith('_ansible_'):
del result[k]
return json.dumps(result, indent=indent, ensure_ascii=False, sort_keys=sort_keys)
# All result keys stating with _ansible_ are internal, so remove them from the result before we output anything.
for k in result.keys():
if isinstance(k, string_types) and k.startswith('_ansible_'):
del result[k]
return json.dumps(result, indent=indent, ensure_ascii=False, sort_keys=sort_keys)
def _handle_warnings(self, res):
''' display warnings, if enabled and any exist in the result '''