diff options
Diffstat (limited to 'common.py')
-rw-r--r-- | common.py | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -42,11 +42,18 @@ def load_config(path=None, groupnames=None): # validate sources destinations = {} - for name, layer in layers.items(): - if isinstance(layer, dict): - layers[name] = layer = [layer] - - for sourcedef in layer: + for name, layerdefs in layers.items(): + if isinstance(layerdefs, dict) and 'sources' not in layerdefs: + layers[name] = { 'sources': [layerdefs] } + for k in ['description', 'create']: + if k in layerdefs: + layers[name][k] = layerdefs.pop(k) + layerdefs = layers[name] + + if 'sources' not in layerdefs: + raise Exception(f'Layer "{name}" does not have any source receipe') + + for sourcedef in layerdefs.get('sources', []): source = sourcedef.get('source', None) if source is None: continue |