fix collection jinja2 cache issue (#62543)
* prevents premature lookup (and potential KeyError) of Jinja filter/test function cache that's not fully populated
(cherry picked from commit d0c7b42e58
)
This commit is contained in:
parent
3d00ffc154
commit
9bbaa0d688
2 changed files with 4 additions and 4 deletions
2
changelogs/fragments/collection_jinja_cache_fix.yml
Normal file
2
changelogs/fragments/collection_jinja_cache_fix.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- collection loader - ensure Jinja function cache is fully-populated before lookup
|
|
@ -350,12 +350,10 @@ class JinjaPluginIntercept(MutableMapping):
|
|||
|
||||
for f in iteritems(method_map()):
|
||||
fq_name = '.'.join((parent_prefix, f[0]))
|
||||
# FIXME: detect/warn on intra-collection function name collisions
|
||||
self._collection_jinja_func_cache[fq_name] = f[1]
|
||||
|
||||
function_impl = self._collection_jinja_func_cache[key]
|
||||
|
||||
# FIXME: detect/warn on intra-collection function name collisions
|
||||
|
||||
function_impl = self._collection_jinja_func_cache[key]
|
||||
return function_impl
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
|
|
Loading…
Reference in a new issue