summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-10-25 20:02:38 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-10-25 20:06:17 +0900
commitb648bcab88340ea470098c9d2af60d3f556a51d6 (patch)
treecf2dd6f4814ad333899f09f59b8dd6e92f86c005 /buildstream
parent9285f004162efeb09b4622ffe28edeeeb43f4262 (diff)
downloadbuildstream-b648bcab88340ea470098c9d2af60d3f556a51d6.tar.gz
project.py: Fetch element type overrides before assertions
The element overrides are intended for later recomposition onto the element type specific yaml files, so it is incorrect to assert that array composition is complete at this stage. Instead remove the element overrides and store those seperately before making our final yaml assertions. This fixes issue #127
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/project.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/buildstream/project.py b/buildstream/project.py
index c4b38a5c5..bcccb718a 100644
--- a/buildstream/project.py
+++ b/buildstream/project.py
@@ -129,6 +129,11 @@ class Project():
# Load project local config and override the builtin
project_conf = _yaml.load(projectfile)
_yaml.composite(config, project_conf)
+
+ # Element type configurations will be composited later onto element types,
+ # so we delete it from here and run our final assertion after.
+ self._elements = _yaml.node_get(config, Mapping, 'elements', default_value={})
+ config.pop('elements', None)
_yaml.node_final_assertions(config)
_yaml.node_validate(config, [
'required-versions',
@@ -243,9 +248,6 @@ class Project():
# Load project split rules
self._splits = _yaml.node_get(config, Mapping, 'split-rules')
- # Element configurations
- self._elements = _yaml.node_get(config, Mapping, 'elements', default_value={})
-
# _list_workspaces()
#
# Generator function to enumerate workspaces.