From: Zack Cerza Date: Mon, 23 Jun 2014 22:53:03 +0000 (-0600) Subject: Fix bug where the base yaml wasn't being merged X-Git-Tag: 1.1.0~1378 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=173c7b84f64cebe38db138466ffd2f8c62c9a697;p=teuthology.git Fix bug where the base yaml wasn't being merged Signed-off-by: Zack Cerza --- diff --git a/teuthology/schedule.py b/teuthology/schedule.py index 58cb77b8..3338e24a 100644 --- a/teuthology/schedule.py +++ b/teuthology/schedule.py @@ -24,7 +24,9 @@ def build_config(args): config_paths = args.get('', 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: diff --git a/teuthology/suite.py b/teuthology/suite.py index cc18ab09..88120dfe 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -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,