mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Check one more skipped scenario in with_subelements.
This commit is contained in:
parent
9124ebb4f1
commit
3f968ff46a
1 changed files with 4 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue