mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
More work on getting integration tests running for v2
This commit is contained in:
@@ -20,6 +20,7 @@ from re import compile as re_compile, IGNORECASE
|
||||
from ansible.errors import *
|
||||
from ansible.parsing.splitter import parse_kv
|
||||
from ansible.plugins.lookup import LookupBase
|
||||
from ansible.template import Templar
|
||||
|
||||
# shortcut format
|
||||
NUM = "(0?x?[0-9a-f]+)"
|
||||
@@ -174,15 +175,18 @@ class LookupModule(LookupBase):
|
||||
if isinstance(terms, basestring):
|
||||
terms = [ terms ]
|
||||
|
||||
templar = Templar(loader=self._loader, variables=variables)
|
||||
|
||||
for term in terms:
|
||||
try:
|
||||
self.reset() # clear out things for this iteration
|
||||
|
||||
term = templar.template(term)
|
||||
try:
|
||||
if not self.parse_simple_args(term):
|
||||
self.parse_kv_args(parse_kv(term))
|
||||
except Exception, e:
|
||||
raise AnsibleError("unknown error parsing with_sequence arguments: %r" % term)
|
||||
raise AnsibleError("unknown error parsing with_sequence arguments: %r. Error was: %s" % (term, e))
|
||||
|
||||
self.sanity_check()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user