From d0c2b712f968791d9d82786ded34c3c77f59f785 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Mon, 20 Oct 2014 21:16:25 -0700 Subject: [PATCH] display informative error message if schedule fails to deep_merge Display the two yaml structures that fail to merge in case of an exception. That's a useful hint to find out what's wrong. Signed-off-by: Loic Dachary --- teuthology/schedule.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/teuthology/schedule.py b/teuthology/schedule.py index 6028050509..ea450ec171 100644 --- a/teuthology/schedule.py +++ b/teuthology/schedule.py @@ -34,7 +34,11 @@ def build_config(args): for conf_path in config_paths: with file(conf_path) as partial_file: partial_dict = yaml.safe_load(partial_file) - conf_dict = deep_merge(conf_dict, partial_dict) + try: + conf_dict = deep_merge(conf_dict, partial_dict) + except Exception: + pprint.pprint("failed to merge {0} into {1}".format(conf_dict, partial_dict)) + raise # strip out targets; the worker will allocate new ones when we run # the job with --lock. if 'targets' in conf_dict: -- 2.39.5