keep unsafe .. unsafe (#23742)

* keep unsafe .. unsafe

fixes #23734, which was broken in previous fix that allowed non string types to be templated
use new 'is_template' function vs bastardizing others
refactored clean_data to allow for arbitrary data structures to clean
fixed/removed some tests

* deal with complex data for is_template

* typos
This commit is contained in:
Brian Coca 2017-04-21 16:07:38 -04:00 committed by GitHub
commit 4594bee65a
6 changed files with 87 additions and 64 deletions

View file

@ -139,7 +139,7 @@ class Conditional:
if conditional in all_vars and VALID_VAR_REGEX.match(conditional):
conditional = all_vars[conditional]
if templar._clean_data(conditional) != conditional:
if templar.is_template(conditional):
display.warning('when statements should not include jinja2 '
'templating delimiters such as {{ }} or {%% %%}. '
'Found: %s' % conditional)