mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Allow to make the jsonfile cache files pretty (indented and sorted) (#17000)
* Allow to make the jsonfile cache files pretty (indented and sorted) Since the json cache files are condensed, it is not very practical to look for something in them. Having indented/sorted cache files makes debugging and playbook/inventory development a lot easier to do. I made it configurable in case people would object to the performance hit this would have, but to be honest, then they probably should be looking at other cache plugins instead IMO. * Removed the config option and documentation changes
This commit is contained in:
parent
43febc76c9
commit
718f431466
1 changed files with 1 additions and 1 deletions
2
lib/ansible/plugins/cache/jsonfile.py
vendored
2
lib/ansible/plugins/cache/jsonfile.py
vendored
|
@ -99,7 +99,7 @@ class CacheModule(BaseCacheModule):
|
|||
display.warning("error while trying to write to %s : %s" % (cachefile, to_bytes(e)))
|
||||
pass
|
||||
else:
|
||||
f.write(jsonify(value))
|
||||
f.write(jsonify(value, format=True))
|
||||
finally:
|
||||
try:
|
||||
f.close()
|
||||
|
|
Loading…
Reference in a new issue