diff --git a/lib/ansible/template/safe_eval.py b/lib/ansible/template/safe_eval.py index 5e2d1e1fe38..300e634592e 100644 --- a/lib/ansible/template/safe_eval.py +++ b/lib/ansible/template/safe_eval.py @@ -107,7 +107,7 @@ def safe_eval(expr, locals={}, include_exceptions=False): parsed_tree = ast.parse(expr, mode='eval') cnv.visit(parsed_tree) compiled = compile(parsed_tree, expr, 'eval') - result = eval(compiled, {}, locals) + result = eval(compiled, {}, dict(locals)) if include_exceptions: return (result, None)