Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport tojson filter from #48309 to 2018.3 #48339

Merged
merged 7 commits into from
Jul 2, 2018

Conversation

terminalmage
Copy link
Contributor

@terminalmage terminalmage commented Jun 27, 2018

This filter is a superior way to dump data structures into SLS and is less problematic than json_encode_dict, which A) doesn't emit actual JSON, and B) emits strings as bytestrings, which would cause an error in Python 3.

@dijit
Copy link
Contributor

dijit commented Jun 29, 2018

Looks good, could use some more tests if this is replacing the current jinja JSON filter.

@terminalmage
Copy link
Contributor Author

@dijit It doesn't replace it, if the installed version of Jinja has a tojson filter then the upstream version of the filter is used. This is just implemented so people on LTS Linux distros can use the filter.

I'm curious what other tests you think could be added, though. The unit test I added was pretty straightforward.

@rallytime rallytime merged commit 5b38019 into saltstack:2018.3 Jul 2, 2018
@terminalmage terminalmage deleted the backport-tojson-filter branch July 13, 2018 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants