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

Update 2019.2.0 release notes with other tojson example #51962

Merged
merged 7 commits into from Mar 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions doc/topics/releases/2019.2.0.rst
Expand Up @@ -49,6 +49,24 @@ Jinja filter`_:
- context:
data: {{ data|tojson }}

Another example where the new filter needs to be used is the following state example:

.. code-block:: jinja

grafana_packages:
pkg.installed:
- names: {{ server.pkgs }}

This will fail when pkgs is a list or dictionary. You will need to update the state:

.. code-block:: jinja

grafana_packages:
pkg.installed:
- names: {{ server.pkgs|tojson }}

This test case has also been tested with the ``yaml`` and ``json`` filters successfully.

.. note::
This filter was added in Jinja 2.9. However, fear not! The 2018.3.3 release
added a ``tojson`` filter which will be used if this filter is not already
Expand Down