Use _wrap_native_text only for builtin STRING_TYPE_FILTERS (#71801)
This commit is contained in:
parent
08cc6edc64
commit
252685092c
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Apply ``_wrap_native_text`` only for builtin filters specified in STRING_TYPE_FILTERS.
|
|
@ -511,7 +511,8 @@ class JinjaPluginIntercept(MutableMapping):
|
||||||
for func_name, func in iteritems(method_map()):
|
for func_name, func in iteritems(method_map()):
|
||||||
fq_name = '.'.join((parent_prefix, func_name))
|
fq_name = '.'.join((parent_prefix, func_name))
|
||||||
# FIXME: detect/warn on intra-collection function name collisions
|
# FIXME: detect/warn on intra-collection function name collisions
|
||||||
if self._jinja2_native and func_name in C.STRING_TYPE_FILTERS:
|
if self._jinja2_native and fq_name.startswith(('ansible.builtin.', 'ansible.legacy.')) and \
|
||||||
|
func_name in C.STRING_TYPE_FILTERS:
|
||||||
self._collection_jinja_func_cache[fq_name] = _wrap_native_text(func)
|
self._collection_jinja_func_cache[fq_name] = _wrap_native_text(func)
|
||||||
else:
|
else:
|
||||||
self._collection_jinja_func_cache[fq_name] = _unroll_iterator(func)
|
self._collection_jinja_func_cache[fq_name] = _unroll_iterator(func)
|
||||||
|
|
Loading…
Reference in a new issue