Skip to content

porting guide 2.19 - describe lazy complex var eval impact on builtin filters/tests #2639

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

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/docsite/rst/porting_guides/porting_guide_core_2.19.rst
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,24 @@ Noteworthy plugin changes
This filter now returns ``False`` instead of ``None`` when the input is ``None``.
The aforementioned deprecation warning is also issued in this case.

* Passing nested non-scalars with embedded templates that may resolve to ``Undefined`` to Jinja2
filter plugins such as ``default`` and ``mandatory``, and test plugins including ``defined`` and ``undefined``
no longer evaluate the same, since nested non-scalars with embedded templates are only templated on use.
In 2.19, this assertion passes:

.. code-block:: yaml

- assert:
that:
- complex_var is defined
- (complex_var | default(unused)).nested is undefined
- complex_var.nested is undefined
vars:
complex_var:
nested: "{{ undefined_variable }}"
unused:
nested: default


Porting custom scripts
======================
Expand Down