mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 00:22:10 +02:00
Avoid redundant unsafe wrapping in ansible_eval_concat (#80143)
The wrap_var is done in do_template for all concat functions after their return.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "``ansible_eval_concat`` - avoid redundant unsafe wrapping of templated strings converted to Python types"
|
||||
@@ -14,7 +14,6 @@ from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode
|
||||
from ansible.utils.native_jinja import NativeJinjaText
|
||||
from ansible.utils.unsafe_proxy import wrap_var
|
||||
|
||||
|
||||
_JSON_MAP = {
|
||||
@@ -60,7 +59,6 @@ def ansible_eval_concat(nodes):
|
||||
|
||||
# if this looks like a dictionary, list or bool, convert it to such
|
||||
if out.startswith(('{', '[')) or out in ('True', 'False'):
|
||||
unsafe = hasattr(out, '__UNSAFE__')
|
||||
try:
|
||||
out = ast.literal_eval(
|
||||
ast.fix_missing_locations(
|
||||
@@ -71,9 +69,6 @@ def ansible_eval_concat(nodes):
|
||||
)
|
||||
except (ValueError, SyntaxError, MemoryError):
|
||||
pass
|
||||
else:
|
||||
if unsafe:
|
||||
out = wrap_var(out)
|
||||
|
||||
return out
|
||||
|
||||
|
||||
Reference in New Issue
Block a user