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:
parent
5584998e0e
commit
235a851350
2 changed files with 4 additions and 2 deletions
2
changelogs/fragments/10566-merge_variables.yml
Normal file
2
changelogs/fragments/10566-merge_variables.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- "merge_variables lookup plugin - avoid deprecated functionality from ansible-core 2.19 (https://github.com/ansible-collections/community.general/pull/10566)."
|
||||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue