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
pull/17016/head
Dag Wieers 8 years ago committed by Brian Coca
parent 43febc76c9
commit 718f431466

@ -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…
Cancel
Save