mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
less code
This commit is contained in:
parent
f0f20d8a1c
commit
952e842720
1 changed files with 6 additions and 5 deletions
|
@ -194,14 +194,15 @@ class TaskExecutor:
|
||||||
items = None
|
items = None
|
||||||
if self._task.loop:
|
if self._task.loop:
|
||||||
if self._task.loop in self._shared_loader_obj.lookup_loader:
|
if self._task.loop in self._shared_loader_obj.lookup_loader:
|
||||||
|
fail = True
|
||||||
if self._task.loop == 'first_found':
|
if self._task.loop == 'first_found':
|
||||||
# first_found loops are special. If the item is undefined then we want to fall through to the next value rather than failing.
|
# first_found loops are special. If the item is undefined then we want to fall through to the next value rather than failing.
|
||||||
loop_terms = listify_lookup_plugin_terms(terms=self._task.loop_args, templar=templar, loader=self._loader, fail_on_undefined=False,
|
fail = False
|
||||||
convert_bare=False)
|
|
||||||
|
loop_terms = listify_lookup_plugin_terms(terms=self._task.loop_args, templar=templar, loader=self._loader, fail_on_undefined=fail,
|
||||||
|
convert_bare=False)
|
||||||
|
if not fail:
|
||||||
loop_terms = [t for t in loop_terms if not templar._contains_vars(t)]
|
loop_terms = [t for t in loop_terms if not templar._contains_vars(t)]
|
||||||
else:
|
|
||||||
loop_terms = listify_lookup_plugin_terms(terms=self._task.loop_args, templar=templar, loader=self._loader, fail_on_undefined=True,
|
|
||||||
convert_bare=False)
|
|
||||||
|
|
||||||
# get lookup
|
# get lookup
|
||||||
mylookup = self._shared_loader_obj.lookup_loader.get(self._task.loop, loader=self._loader, templar=templar)
|
mylookup = self._shared_loader_obj.lookup_loader.get(self._task.loop, loader=self._loader, templar=templar)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue