mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
minor fixes to template function
- make sure it calls itself correctly, now passes same params as it recieves - vars is reserved, changed for templatevars to avoid confustion - forcing mustaches again since the removal broke 'listification' as per #9622 - fixes incorrectly successful tests using undefined var, now it is defined - now returns empty list if items is None to avoid errors
This commit is contained in:
@@ -1469,7 +1469,7 @@ def listify_lookup_plugin_terms(terms, basedir, inject):
|
||||
# if not already a list, get ready to evaluate with Jinja2
|
||||
# not sure why the "/" is in above code :)
|
||||
try:
|
||||
new_terms = template.template(basedir, terms, inject, convert_bare=True, fail_on_undefined=C.DEFAULT_UNDEFINED_VAR_BEHAVIOR)
|
||||
new_terms = template.template(basedir, "{{%s}}" % terms, inject, convert_bare=True, fail_on_undefined=C.DEFAULT_UNDEFINED_VAR_BEHAVIOR)
|
||||
if isinstance(new_terms, basestring) and "{{" in new_terms:
|
||||
pass
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user