Content-Length: 304053 | pFad | http://github.com/saltstack/salt/pull/65004/commits/f9142857a068df86e29fa02d78ed0199145c46d4

61 [3006.x][WIP] Handle StrictUndefined for all salt added jinja filters by cmcmarrow · Pull Request #65004 · saltstack/salt · GitHub
Skip to content

[3006.x][WIP] Handle StrictUndefined for all salt added jinja filters #65004

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 7 commits into
base: 3006.x
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
add python tests
  • Loading branch information
cmcmarrow authored and twangboy committed May 16, 2025
commit f9142857a068df86e29fa02d78ed0199145c46d4
37 changes: 37 additions & 0 deletions tests/pytests/unit/utils/jinja/test_jinja_custom_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,40 @@ def test_yaml():
def test_json():
_render_fail(JSON_SLS_ERROR)
assert _render(JSON_SLS) == JSON_SLS_RIGHT

PYTHON_SLS_ERROR = """
{%- set ports = {'http': 80} %}

huh:
test.configurable_test_state:
- changes: true
- result: true
- comment: https port is {{ [ports['https23'], ports['https']] | python }}
- comment2: https port is {{ [666 + 1, ports['https2']] | python }}
- comment3: https port is {{ [666 + 1, ports['https2']] | python }}
"""


PYTHON_SLS = """
{%- set ports = {'https': 80} %}

huh:
test.configurable_test_state:
- changes: true
- result: true
- comment: https port is {{ [666 + 1, ports['https']] | python }}
"""


PYTHON_SLS_RIGHT = """

huh:
test.configurable_test_state:
- changes: true
- result: true
- comment: https port is [667, 80]"""


def test_python():
_render_fail(PYTHON_SLS_ERROR)
assert _render(PYTHON_SLS) == PYTHON_SLS_RIGHT
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/saltstack/salt/pull/65004/commits/f9142857a068df86e29fa02d78ed0199145c46d4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy