mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-13 03:44:02 -07:00
parent
e8e1d9f6fb
commit
c9a004227e
5 changed files with 71 additions and 60 deletions
|
@ -34,8 +34,7 @@ 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
|
||||
|
||||
if not isinstance(ds, (list, type(None))):
|
||||
raise AnsibleParserError('block has bad type: "%s". Expecting "list"' % type(ds).__name__, obj=ds)
|
||||
assert isinstance(ds, (list, type(None)))
|
||||
|
||||
block_list = []
|
||||
if ds:
|
||||
|
@ -74,13 +73,11 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
|||
from ansible.playbook.handler import Handler
|
||||
from ansible.playbook.task import Task
|
||||
|
||||
if not isinstance(ds, list):
|
||||
raise AnsibleParserError('task has bad type: "%s". Expected "list"' % type(ds).__name__, obj=ds)
|
||||
assert isinstance(ds, list)
|
||||
|
||||
task_list = []
|
||||
for task in ds:
|
||||
if not isinstance(task, dict):
|
||||
raise AnsibleParserError('task/handler has bad type: "%s". Expected "dict"' % type(task).__name__, obj=task)
|
||||
assert isinstance(task, dict)
|
||||
|
||||
if 'block' in task:
|
||||
t = Block.load(
|
||||
|
@ -113,8 +110,7 @@ def load_list_of_roles(ds, play, current_role_path=None, variable_manager=None,
|
|||
# we import here to prevent a circular dependency with imports
|
||||
from ansible.playbook.role.include import RoleInclude
|
||||
|
||||
if not isinstance(ds, list):
|
||||
raise AnsibleParserError('roles has bad type: "%s". Expectes "list"' % type(ds).__name__, obj=ds)
|
||||
assert isinstance(ds, list)
|
||||
|
||||
roles = []
|
||||
for role_def in ds:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue