Fix errors in lookup plugins.

Lookup plugins 'sequence' and 'template' now import 'ansible.utils'
appropriately in order to use the 'listify_lookup_plugin_terms'
function.

Also, 'dnstxt' and 'env' now check to see if 'terms' is a string;
without this calls like '{{ lookup('env', 'HOME') }}' fail.
This commit is contained in:
C. Morgan Hamill 2013-04-17 11:06:15 -04:00
parent cce2cad8dc
commit 663d37b537
5 changed files with 9 additions and 5 deletions

View file

@ -16,7 +16,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from ansible.errors import AnsibleError
from ansible.utils import parse_kv
import ansible.utils as utils
from re import compile as re_compile, IGNORECASE
# shortcut format
@ -181,7 +181,7 @@ class LookupModule(object):
try:
if not self.parse_simple_args(term):
self.parse_kv_args(parse_kv(term))
self.parse_kv_args(utils.parse_kv(term))
except Exception:
raise AnsibleError(
"unknown error parsing with_sequence arguments: %r"