From: Zack Cerza Date: Thu, 12 Jun 2014 17:50:41 +0000 (-0500) Subject: Don't reread the entire yaml file... X-Git-Tag: 1.1.0~1389 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19d73071d13941bcfb1875e7504dd7167509158f;p=teuthology.git Don't reread the entire yaml file... Signed-off-by: Zack Cerza --- diff --git a/teuthology/suite.py b/teuthology/suite.py index 0810666bc..fb6c10e3d 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