diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-02-13 10:05:42 +0000 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-02-13 10:05:42 +0000 |
commit | 50a4d2c088d609d7a9e30e5a0bfb1635cfc2498c (patch) | |
tree | 2a0e50f27bc83fc636d7b092a320bf70a5ffbfbd /ybd/splitting.py | |
parent | 2b961f39dbf41588a62727f54811ad185eb55ef1 (diff) | |
download | ybd-50a4d2c088d609d7a9e30e5a0bfb1635cfc2498c.tar.gz |
Move splitting.load_metafile() => cache.get_metadata()
Diffstat (limited to 'ybd/splitting.py')
-rw-r--r-- | ybd/splitting.py | 26 |
1 files changed, 3 insertions, 23 deletions
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'] |