1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/template/templates
Zac Medico 501fc7a248 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
2017-08-09 18:50:53 -04:00
..
bar template: fix KeyError: 'undefined variable: 0 (#27972) 2017-08-09 18:50:53 -04:00
foo.j2 Migrate Linux CI roles to test targets. (#17997) 2016-10-13 09:09:25 -07:00
foo2.j2 Windows: Use the correct newline sequence for the platform (#21846) 2017-03-23 19:47:10 -07:00
foo3.j2 Windows: Use the correct newline sequence for the platform (#21846) 2017-03-23 19:47:10 -07:00
import_as.j2 template: fix KeyError: 'undefined variable: 0 (#27972) 2017-08-09 18:50:53 -04:00
import_as_with_context.j2 template: fix KeyError: 'undefined variable: 0 (#27972) 2017-08-09 18:50:53 -04:00
import_as_with_context.js template: fix KeyError: 'undefined variable: 0 (#27972) 2017-08-09 18:50:53 -04:00
import_with_context.j2 template: fix KeyError: 'undefined variable: 0 (#27972) 2017-08-09 18:50:53 -04:00
parent.j2 Don't restrict local jinja2 variables to those that start with l_ 2017-01-20 07:15:51 -06:00
qux template: fix KeyError: 'undefined variable: 0 (#27972) 2017-08-09 18:50:53 -04:00
short.j2 Migrate Linux CI roles to test targets. (#17997) 2016-10-13 09:09:25 -07:00
subtemplate.j2 Don't restrict local jinja2 variables to those that start with l_ 2017-01-20 07:15:51 -06:00