mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
* Fix #23078 - eliminate trailing whitespace in to_nice_json * Add changelog fragment for #42633
This commit is contained in:
committed by
Matt Martz
parent
d779eb1f15
commit
6f480fd03d
@@ -87,7 +87,7 @@ def to_json(a, *args, **kw):
|
||||
def to_nice_json(a, indent=4, *args, **kw):
|
||||
'''Make verbose, human readable JSON'''
|
||||
try:
|
||||
return json.dumps(a, indent=indent, sort_keys=True, cls=AnsibleJSONEncoder, *args, **kw)
|
||||
return json.dumps(a, indent=indent, sort_keys=True, separators=(',', ': '), cls=AnsibleJSONEncoder, *args, **kw)
|
||||
except Exception as e:
|
||||
# Fallback to the to_json filter
|
||||
display.warning(u'Unable to convert data using to_nice_json, falling back to to_json: %s' % to_text(e))
|
||||
|
||||
Reference in New Issue
Block a user