Skip to content

Commit 06f616d

Browse files
authored
Revert 'Don't pass deprecated disable_lookups to template function' (#4650)
1 parent 8c9b342 commit 06f616d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ansiblelint/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def ansible_template(
177177
"""Render a templated string by mocking missing filters.
178178
179179
In the case of a missing lookup, ansible core does an early exit
180-
but this happens after the jinja2 syntax already passed
180+
when disable_lookup=True but this happens after the jinja2 syntax already passed
181181
return the original string as if it had been templated.
182182
183183
In the case of a missing filter, extract the missing filter plugin name
@@ -201,6 +201,7 @@ def ansible_template(
201201
re_valid_filter = re.compile(r"^\w+(\.\w+\.\w+)?$")
202202
templar = ansible_templar(basedir=basedir, templatevars=templatevars)
203203

204+
kwargs["disable_lookups"] = True
204205
for _i in range(10):
205206
try:
206207
if TrustedAsTemplate and not isinstance(varname, TrustedAsTemplate):

0 commit comments

Comments
 (0)