mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
template: fix KeyError: 'undefined variable: 0 (#27972)
* template: fix KeyError: 'undefined variable: 0
For compatibility with the Context.get_all() implementation
in jinja 2.9, make AnsibleJ2Vars implement collections.Mapping.
Also, make AnsibleJ2Template.newcontext() handle dict type
for the 'vars' parameter.
See: d67f0fd4cc
Fixes: https://github.com/ansible/ansible/issues/20494
* add units/template/test_vars
* intg tests for jinja-2.9 issues like 20494
test cases here are based on
https://github.com/ansible/ansible/issues/20494#issue-202108318
This commit is contained in:
parent
49aa64a5b8
commit
501fc7a248
13 changed files with 160 additions and 2 deletions
|
@ -0,0 +1,3 @@
|
|||
hello world with context
|
||||
WIBBLE
|
||||
Goodbye
|
Loading…
Add table
Add a link
Reference in a new issue