From 0f0f5ff1ceb3be8fec991dfe1e83aa9d07534157 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 23 Apr 2014 13:13:46 +0200 Subject: [PATCH] Give more information when a task is empty I made a typo in a playbook and was great by: ERROR: expecting dict; got: None The issue was a single - on the last line of a playbook. With the name of the file, I was able to see right away where the error was. --- lib/ansible/playbook/play.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 58f56db2302..639f4c065b4 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -505,7 +505,7 @@ class Play(object): included_additional_conditions = list(old_conditions) if not isinstance(x, dict): - raise errors.AnsibleError("expecting dict; got: %s" % x) + raise errors.AnsibleError("expecting dict; got: %s, error in %s" % (x, original_file)) # evaluate sudo vars for current and child tasks included_sudo_vars = {}