1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix wrong error class (#17259)

AnsibleError is not imported in that file, and since that's
a parsing time issue, better raise AnsibleParserError like the
rest of the file.

Issue signaled on irc by gordon`
This commit is contained in:
Michael Scherer 2016-08-26 14:53:28 +02:00 committed by Brian Coca
parent 4a3a9c0f2d
commit a942758a07

View file

@ -191,7 +191,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
if data is None: if data is None:
return [] return []
elif not isinstance(data, list): elif not isinstance(data, list):
raise AnsibleError("included task files must contain a list of tasks", obj=data) raise AnsibleParserError("included task files must contain a list of tasks", obj=data)
# since we can't send callbacks here, we display a message directly in # since we can't send callbacks here, we display a message directly in
# the same fashion used by the on_include callback. We also do it here, # the same fashion used by the on_include callback. We also do it here,