diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-02-17 22:24:54 +0900 |
---|---|---|
committer | GitLab <gitlab@gitlab.com> | 2017-02-18 12:45:24 +0000 |
commit | 3e638480bff0e125eef173b68cb8467feefd72ab (patch) | |
tree | 4320fb7e1ab32e564d5887bb8c0cd1db7ce1728e | |
parent | 4a44598abdb8ba83bf2ee9099b2a69ac645ee94e (diff) | |
download | ybd-tristan/empty-stratum.tar.gz |
splitting.py: Print a warning if stratum does not have contentstristan/empty-stratum
This is better than crashing, but happens when a system references
a stratum that doesnt exist. This is better than the crash but
the error should be found at load time.
-rw-r--r-- | ybd/splitting.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ybd/splitting.py b/ybd/splitting.py index 38ead98..3797a1f 100644 --- a/ybd/splitting.py +++ b/ybd/splitting.py @@ -67,7 +67,10 @@ def move_required_files(dn, stratum, artifacts): with open(split_stratum_metafile, "w") as f: yaml.safe_dump(split_stratum_metadata, f, default_flow_style=False) - for path in stratum['contents']: + if not stratum.get('contents'): + log(dn, 'WARNING: Stratum "%s" has no contents !!!' % stratum['name']) + + for path in stratum.get('contents', []): chunk = app.defs.get(path) if chunk.get('build-mode', 'staging') == 'bootstrap': continue |