reset defaults for json filters (#76349)

* reset defaults for json filters

  these had change on unification of json parsing/dumping
  now they behave like before, but are still controllable by user.
pull/76439/head
Brian Coca 3 years ago committed by GitHub
parent de11a1ce78
commit 480d47d071
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- to_json/to_nice_json filters defaults back to unvaulting/no unsafe packing.

@ -65,6 +65,13 @@ def to_nice_yaml(a, indent=4, *args, **kw):
def to_json(a, *args, **kw):
''' Convert the value to JSON '''
# defualts for filters
if 'vault_to_text' not in kw:
kw['vault_to_text'] = True
if 'preprocess_unsafe' not in kw:
kw['preprocess_unsafe'] = False
return json.dumps(a, cls=AnsibleJSONEncoder, *args, **kw)

Loading…
Cancel
Save