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 7 commits into from Jul 2, 2018


None yet
3 participants

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.

terminalmage added some commits Jun 26, 2018

Deprecate json_encode_dict and json_encode_list jinja filters
These should be replaced with "tojson".

This comment has been minimized.


dijit commented Jun 29, 2018

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


This comment has been minimized.


terminalmage commented Jun 29, 2018

@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 referenced this pull request Jul 2, 2018

@rallytime rallytime merged commit 5b38019 into saltstack:2018.3 Jul 2, 2018

7 of 10 checks passed

continuous-integration/jenkins/pr-merge This commit cannot be built
default Pull Requests » Salt PR - Main Build - PY2/PY3 #9802
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #11046 — FAILURE
WIP ready for review
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #26280 — SUCCESS
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #18326 — SUCCESS
jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #6076 — SUCCESS
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #24004 — SUCCESS
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #22961 — SUCCESS
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #20129 — SUCCESS

@terminalmage terminalmage deleted the terminalmage:backport-tojson-filter branch Jul 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment