From 50a4d2c088d609d7a9e30e5a0bfb1635cfc2498c Mon Sep 17 00:00:00 2001 From: Paul Sherwood Date: Sat, 13 Feb 2016 10:05:42 +0000 Subject: Move splitting.load_metafile() => cache.get_metadata() --- ybd/splitting.py | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'ybd/splitting.py') diff --git a/ybd/splitting.py b/ybd/splitting.py index 12cb882..123ebac 100644 --- a/ybd/splitting.py +++ b/ybd/splitting.py @@ -15,7 +15,7 @@ # =*= License: GPL-2 =*= import app -from cache import cache, cache_key, get_cache, get_remote +from cache import cache, cache_key, get_cache, get_remote, get_metadata import os import glob import re @@ -24,26 +24,6 @@ import yaml import utils -def load_metafile(defs, target): - '''Load an individual .meta file for a chunk or stratum - - The .meta file is expected to be in the .unpacked/baserock directory of the - built artifact - - ''' - target = defs.get(target) - metafile = os.path.join(get_cache(defs, target) + '.unpacked', 'baserock', - target['name'] + '.meta') - try: - with open(metafile, "r") as f: - metadata = yaml.safe_load(f) - app.log(target, 'Loaded metadata for', target['path']) - return metadata - except: - app.log(name, 'WARNING: problem loading metadata', metafile) - return None - - def install_stratum_artifacts(defs, component, stratum, artifacts): '''Create the .meta files for a split stratum @@ -56,7 +36,7 @@ def install_stratum_artifacts(defs, component, stratum, artifacts): stratum['name'] + '.meta')): return - stratum_metadata = load_metafile(defs, stratum['path']) + stratum_metadata = get_medata(defs, stratum['path']) split_stratum_metadata = {} split_stratum_metadata['products'] = [] components = [] @@ -216,7 +196,7 @@ def write_stratum_metafiles(defs, stratum): if chunk.get('build-mode', 'staging') == 'bootstrap': continue - metadata = load_metafile(defs, chunk['path']) + metadata = get_metadata(defs, chunk['path']) split_metadata = {} split_metadata['ref'] = metadata['ref'] split_metadata['repo'] = metadata['repo'] -- cgit v1.2.1