now handles 'non file diffs'

this allows modules to pass back a 'diff' dict and it will still show using the file interface
This commit is contained in:
Brian Coca 2016-01-04 18:44:09 -05:00
parent 7e318e8398
commit c14e099dd7

View file

@ -105,6 +105,10 @@ class CallbackBase:
if 'src_larger' in diff:
ret.append("diff skipped: source file size is greater than %d\n" % diff['src_larger'])
if 'before' in diff and 'after' in diff:
# format complex structures into 'files'
for x in ['before', 'after']:
if isinstance(diff[x], dict):
diff[x] = json.dumps(diff[x], sort_keys=True, indent=4)
if 'before_header' in diff:
before_header = "before: %s" % diff['before_header']
else: