From 7291f9e96586b2ffa9f0bd110d62b5b0477d0fd6 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 11 Jun 2015 00:13:40 -0400 Subject: [PATCH] removed cruft made sure it does not fail on undefined --- lib/ansible/utils/listify.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/ansible/utils/listify.py b/lib/ansible/utils/listify.py index c8fc97bed79..dfc80120423 100644 --- a/lib/ansible/utils/listify.py +++ b/lib/ansible/utils/listify.py @@ -19,24 +19,23 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from six import iteritems, string_types - -import re from ansible.template import Templar from ansible.template.safe_eval import safe_eval __all__ = ['listify_lookup_plugin_terms'] -LOOKUP_REGEX = re.compile(r'lookup\s*\(') - +#FIXME: probably just move this into lookup plugin base class def listify_lookup_plugin_terms(terms, variables, loader): if isinstance(terms, basestring): stripped = terms.strip() templar = Templar(loader=loader, variables=variables) - terms = templar.template(terms, convert_bare=True) + #FIXME: warn/deprecation on bare vars in with_ so we can eventually remove fail on undefined override + terms = templar.template(terms, convert_bare=True, fail_on_undefined=False) + + #TODO: check if this is needed as template should also return correct type already terms = safe_eval(terms) if isinstance(terms, basestring):