1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

[PR #10566/14f706c5 backport][stable-10] merge_variables lookup: avoid deprecated Templar.set_temporary_context (#10568)

merge_variables lookup: avoid deprecated Templar.set_temporary_context (#10566)

Avoid deprecated Templar.set_temporary_context.

(cherry picked from commit 14f706c5dd)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2025-08-03 13:08:48 +02:00 committed by GitHub
parent 5584998e0e
commit 235a851350
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -194,8 +194,8 @@ class LookupModule(LookupBase):
result = initial_value
for var_name in var_merge_names:
with self._templar.set_temporary_context(available_variables=variables): # tmp. switch renderer to context of current variables
var_value = self._templar.template(variables[var_name]) # Render jinja2 templates
temp_templar = self._templar.copy_with_new_env(available_variables=variables) # tmp. switch renderer to context of current variables
var_value = temp_templar.template(variables[var_name]) # Render jinja2 templates
var_type = _verify_and_get_type(var_value)
if prev_var_type is None: