mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
parent
3ee3e3b5a8
commit
af96cba7e1
1 changed files with 2 additions and 1 deletions
|
@ -22,6 +22,7 @@ __metaclass__ = type
|
||||||
import ast
|
import ast
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from jinja2.compiler import generate
|
||||||
from jinja2.exceptions import UndefinedError
|
from jinja2.exceptions import UndefinedError
|
||||||
|
|
||||||
from ansible.compat.six import text_type
|
from ansible.compat.six import text_type
|
||||||
|
@ -152,7 +153,7 @@ class Conditional:
|
||||||
|
|
||||||
presented = "{%% if %s %%} True {%% else %%} False {%% endif %%}" % conditional
|
presented = "{%% if %s %%} True {%% else %%} False {%% endif %%}" % conditional
|
||||||
res = e._parse(presented, None, None)
|
res = e._parse(presented, None, None)
|
||||||
res = e._generate(res, None, None, defer_init=True)
|
res = generate(res, e, None, None)
|
||||||
parsed = ast.parse(res, mode='exec')
|
parsed = ast.parse(res, mode='exec')
|
||||||
|
|
||||||
class CleansingNodeVisitor(ast.NodeVisitor):
|
class CleansingNodeVisitor(ast.NodeVisitor):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue