summaryrefslogtreecommitdiff
path: root/src/buildstream/_loader
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-09 14:22:35 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:02 +0000
commitfcef3658433f74a2f396ed353bb3534f0001f3d8 (patch)
treea3c74347254332f06583fbdc1c6a6fc4411d21aa /src/buildstream/_loader
parentf6616bc9d51a791aba1e177c61e27f768bebd9cb (diff)
downloadbuildstream-fcef3658433f74a2f396ed353bb3534f0001f3d8.tar.gz
_yaml: add 'get_mapping()' to MappingNode
This allows to get a mapping node from another 'MappingNode', replacing 'node_get(my_mapping, key, type=dict)' Also changes all places where 'node_get' was called like that by the new API.
Diffstat (limited to 'src/buildstream/_loader')
-rw-r--r--src/buildstream/_loader/loader.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/buildstream/_loader/loader.py b/src/buildstream/_loader/loader.py
index b221c48d0..e5730d416 100644
--- a/src/buildstream/_loader/loader.py
+++ b/src/buildstream/_loader/loader.py
@@ -487,12 +487,12 @@ class Loader():
meta_element = MetaElement(self.project, element.name, element_kind,
elt_provenance, meta_sources,
- _yaml.node_get(node, dict, Symbol.CONFIG, default_value={}),
- _yaml.node_get(node, dict, Symbol.VARIABLES, default_value={}),
- _yaml.node_get(node, dict, Symbol.ENVIRONMENT, default_value={}),
+ node.get_mapping(Symbol.CONFIG, default={}),
+ node.get_mapping(Symbol.VARIABLES, default={}),
+ node.get_mapping(Symbol.ENVIRONMENT, default={}),
_yaml.node_get(node, list, Symbol.ENV_NOCACHE, default_value=[]),
- _yaml.node_get(node, dict, Symbol.PUBLIC, default_value={}),
- _yaml.node_get(node, dict, Symbol.SANDBOX, default_value={}),
+ node.get_mapping(Symbol.PUBLIC, default={}),
+ node.get_mapping(Symbol.SANDBOX, default={}),
element_kind == 'junction')
# Cache it now, make sure it's already there before recursing