From 53cd80225143d0011416041f4cd815a07c650772 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 2 Dec 2015 08:13:47 -0800 Subject: [PATCH] better error on invalid task lists --- lib/ansible/playbook/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/helpers.py b/lib/ansible/playbook/helpers.py index c4f11c1c8ed..4b29e8b74f8 100644 --- a/lib/ansible/playbook/helpers.py +++ b/lib/ansible/playbook/helpers.py @@ -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: