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
|
||||
from ansible.playbook.block import Block
|
||||
|
||||
assert isinstance(ds, (list, type(None)))
|
||||
try:
|
||||
assert isinstance(ds, (list, type(None)))
|
||||
except AssertionError:
|
||||
raise AnsibleParserError("Task list is not a list, invalid format provided: %s" % ds)
|
||||
|
||||
block_list = []
|
||||
if ds:
|
||||
|
|
Loading…
Reference in a new issue