Commit 3f968ff4 by Michael DeHaan

Check one more skipped scenario in with_subelements.

parent 9124ebb4
......@@ -39,6 +39,7 @@ class LookupModule(object):
if isinstance(terms[0], dict): # convert to list:
if terms[0].get('skipped',False) != False:
# the registered result was completely skipped
return []
elementlist = []
for key in terms[0].iterkeys():
......@@ -51,6 +52,9 @@ class LookupModule(object):
for item0 in elementlist:
if not isinstance(item0, dict):
raise errors.AnsibleError("subelements lookup expects a dictionary, got '%s'" %item0)
if item0.get('skipped',False) != False:
# this particular item is to be skipped
continue
if not subelement in item0:
raise errors.AnsibleError("could not find '%s' key in iterated item '%s'" % (subelement, item0))
if not isinstance(item0[subelement], list):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment