]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix bug where the base yaml wasn't being merged
authorZack Cerza <zack@cerza.org>
Mon, 23 Jun 2014 22:53:03 +0000 (16:53 -0600)
committerZack Cerza <zack@cerza.org>
Wed, 25 Jun 2014 18:54:23 +0000 (12:54 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/schedule.py
teuthology/suite.py

index 58cb77b8f9fabdbbfc9dd1d7bbfd98ed79c490c7..3338e24a3791db46ab8dde40d3c0e8336ba567d2 100644 (file)
@@ -24,7 +24,9 @@ def build_config(args):
     config_paths = args.get('<conf_file>', list())
     conf_dict = dict()
     for conf_path in config_paths:
-        conf_dict = deep_merge(conf_dict, config_file(conf_path))
+        with file(conf_path) as partial_file:
+            partial_dict = yaml.safe_load(partial_file)
+        conf_dict = deep_merge(conf_dict, partial_dict)
     # strip out targets; the worker will allocate new ones when we run
     # the job with --lock.
     if 'targets' in conf_dict:
index cc18ab09cd19d06b4c8bf75babbc83eb0e3369df..88120dfe2d1857d974b394a9577b17900dd95003 100644 (file)
@@ -58,23 +58,26 @@ def main(args):
                                           teuthology_branch, kernel_branch,
                                           kernel_flavor, distro, machine_type)
 
-    with NamedTemporaryFile(prefix='schedule_suite_') as base_yaml:
+    with NamedTemporaryFile(prefix='schedule_suite_',
+                            delete=False) as base_yaml:
         base_yaml.write(config_string)
-        base_yaml_paths.insert(0, base_yaml.name)
-        prepare_and_schedule(owner=owner,
-                             name=name,
-                             suite=suite,
-                             machine_type=machine_type,
-                             base=base,
-                             base_yaml_paths=base_yaml_paths,
-                             email=email,
-                             priority=priority,
-                             limit=limit,
-                             num=num,
-                             timeout=timeout,
-                             dry_run=dry_run,
-                             verbose=verbose,
-                             )
+        base_yaml_path = base_yaml.name
+    base_yaml_paths.insert(0, base_yaml_path)
+    prepare_and_schedule(owner=owner,
+                            name=name,
+                            suite=suite,
+                            machine_type=machine_type,
+                            base=base,
+                            base_yaml_paths=base_yaml_paths,
+                            email=email,
+                            priority=priority,
+                            limit=limit,
+                            num=num,
+                            timeout=timeout,
+                            dry_run=dry_run,
+                            verbose=verbose,
+                            )
+    os.remove(base_yaml_path)
 
 
 def make_name(suite, ceph_branch, kernel_branch, kernel_flavor, machine_type,