mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
better error on invalid task lists
This commit is contained in:
parent
df16d26b33
commit
53cd802251
1 changed files with 4 additions and 1 deletions
|
@ -34,7 +34,10 @@ def load_list_of_blocks(ds, play, parent_block=None, role=None, task_include=Non
|
||||||
# we import here to prevent a circular dependency with imports
|
# we import here to prevent a circular dependency with imports
|
||||||
from ansible.playbook.block import Block
|
from ansible.playbook.block import Block
|
||||||
|
|
||||||
|
try:
|
||||||
assert isinstance(ds, (list, type(None)))
|
assert isinstance(ds, (list, type(None)))
|
||||||
|
except AssertionError:
|
||||||
|
raise AnsibleParserError("Task list is not a list, invalid format provided: %s" % ds)
|
||||||
|
|
||||||
block_list = []
|
block_list = []
|
||||||
if ds:
|
if ds:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue