From 9d1b2806898f09d8cf5e34a061532a385d433897 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 14 Jan 2016 10:23:35 -0500 Subject: [PATCH] now combine vars errors dump vars very hard to debug w/o knowing what vars were being merged at the time of the error --- lib/ansible/utils/vars.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/utils/vars.py b/lib/ansible/utils/vars.py index a6e42cefa1..569bad2847 100644 --- a/lib/ansible/utils/vars.py +++ b/lib/ansible/utils/vars.py @@ -20,7 +20,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type import ast -from json import JSONEncoder +from json import dumps from collections import MutableMapping from ansible.compat.six import iteritems, string_types @@ -43,9 +43,9 @@ def _validate_mutable_mappings(a, b): # a variable number of arguments instead. if not (isinstance(a, MutableMapping) and isinstance(b, MutableMapping)): - raise AnsibleError("failed to combine variables, expected dicts but" - " got a '{0}' and a '{1}'".format( - a.__class__.__name__, b.__class__.__name__)) + raise AnsibleError("failed to combine variables, expected dicts but got a '{0}' and a '{1}': \n{2}\n{3}".format( + a.__class__.__name__, b.__class__.__name__, dumps(a), dumps(b)) + ) def combine_vars(a, b): """