From 19d73071d13941bcfb1875e7504dd7167509158f Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 12 Jun 2014 12:50:41 -0500 Subject: [PATCH] Don't reread the entire yaml file... Signed-off-by: Zack Cerza --- teuthology/suite.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/teuthology/suite.py b/teuthology/suite.py index 0810666bcd..fb6c10e3d3 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -35,7 +35,7 @@ def main(args): if verbose: teuthology.log.setLevel(logging.DEBUG) - arch = get_arch(base_yaml_paths) + arch = get_arch(machine_type) if ',' in machine_type: worker = 'multi' @@ -270,14 +270,10 @@ def build_matrix(path): return [] -def get_arch(config): - for yamlfile in config: - y = yaml.safe_load(file(yamlfile)) - machine_type = y.get('machine_type') - if machine_type: - locks = lock.list_locks() - for machine in locks: - if machine['type'] == machine_type: - arch = machine['arch'] - return arch +def get_arch(machine_type): + locks = lock.list_locks() + for machine in locks: + if machine['type'] == machine_type: + arch = machine['arch'] + return arch return None -- 2.39.5