Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a import for 'builtins' module, used in CleansingNodeVisitor. #10709

Merged
merged 1 commit into from
Apr 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion v2/ansible/template/safe_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import ast
import sys

from six.moves import builtins

from ansible import constants as C
from ansible.plugins import filter_loader

Expand Down Expand Up @@ -84,7 +86,7 @@ def generic_visit(self, node, inside_call=False):
elif isinstance(node, ast.Call):
inside_call = True
elif isinstance(node, ast.Name) and inside_call:
if hasattr(builtin, node.id) and node.id not in CALL_WHITELIST:
if hasattr(builtins, node.id) and node.id not in CALL_WHITELIST:
raise Exception("invalid function: %s" % node.id)
# iterate over all child nodes
for child_node in ast.iter_child_nodes(node):
Expand Down