]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
display informative error message if schedule fails to deep_merge 344/head
authorLoic Dachary <loic-201408@dachary.org>
Tue, 21 Oct 2014 04:16:25 +0000 (21:16 -0700)
committerLoic Dachary <loic-201408@dachary.org>
Tue, 21 Oct 2014 15:34:01 +0000 (08:34 -0700)
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 <loic-201408@dachary.org>
teuthology/schedule.py

index 6028050509d99f65a9bb7dd8ee663c69cbf8b93a..ea450ec1710aa1c9e627415dc667a0426aba9e79 100644 (file)
@@ -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: