From d52a9cee46553dc461a0bc69bb0459d5f2eb6765 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Fri, 9 Sep 2016 15:33:23 +0200 Subject: [PATCH] Support late evaluation, suppress warnings on SyntaxError (#17462) See #14304 comments (https://github.com/ansible/ansible/pull/14304#issuecomment-245453209) for more information. --- lib/ansible/template/safe_eval.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/template/safe_eval.py b/lib/ansible/template/safe_eval.py index 845216b621d..19c61c9ea7c 100644 --- a/lib/ansible/template/safe_eval.py +++ b/lib/ansible/template/safe_eval.py @@ -137,9 +137,8 @@ def safe_eval(expr, locals={}, include_exceptions=False): else: return result except SyntaxError as e: - display.warning('SyntaxError in safe_eval() on expr: %s (%s)' % (expr, e)) # special handling for syntax errors, we just return - # the expression string back as-is + # the expression string back as-is to support late evaluation if include_exceptions: return (expr, None) return expr