mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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:
parent
22d4dc9d85
commit
9972c27a9b
1 changed files with 4 additions and 0 deletions
|
@ -116,6 +116,10 @@ class CallbackBase:
|
||||||
if 'src_larger' in diff:
|
if 'src_larger' in diff:
|
||||||
ret.append("diff skipped: source file size is greater than %d\n" % diff['src_larger'])
|
ret.append("diff skipped: source file size is greater than %d\n" % diff['src_larger'])
|
||||||
if 'before' in diff and 'after' in diff:
|
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:
|
if 'before_header' in diff:
|
||||||
before_header = "before: %s" % diff['before_header']
|
before_header = "before: %s" % diff['before_header']
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue