mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
Avoid running through the legacy template code if no dollar signs are in strings.
This commit is contained in:
parent
251f19263c
commit
b8c5a58b7f
1 changed files with 2 additions and 0 deletions
|
@ -249,6 +249,8 @@ def template(basedir, varname, vars, lookup_fatal=True, depth=0, expand_lists=Tr
|
||||||
if isinstance(varname, basestring):
|
if isinstance(varname, basestring):
|
||||||
if '{{' in varname or '{%' in varname:
|
if '{{' in varname or '{%' in varname:
|
||||||
varname = template_from_string(basedir, varname, vars)
|
varname = template_from_string(basedir, varname, vars)
|
||||||
|
if not '$' in varname:
|
||||||
|
return varname
|
||||||
|
|
||||||
m = _legacy_varFind(basedir, varname, vars, lookup_fatal, depth, expand_lists)
|
m = _legacy_varFind(basedir, varname, vars, lookup_fatal, depth, expand_lists)
|
||||||
if not m:
|
if not m:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue