summaryrefslogtreecommitdiff
path: root/src/buildstream/_loader
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-07-03 18:01:30 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:03 +0000
commit8c9f41922ad16f8a031ac612bb35e493e8581380 (patch)
treecebc4afe2d0238033362905a99400d4d2824d7dc /src/buildstream/_loader
parentd8466183f77c75bbd7ad27c7cbf5e58189945be1 (diff)
downloadbuildstream-8c9f41922ad16f8a031ac612bb35e493e8581380.tar.gz
_yaml: Remove 'node_validate' and replace by 'MappingNode.validate_keys'
- adapt all call sites to use the new API
Diffstat (limited to 'src/buildstream/_loader')
-rw-r--r--src/buildstream/_loader/loadelement.py4
-rw-r--r--src/buildstream/_loader/types.pyx4
2 files changed, 3 insertions, 5 deletions
diff --git a/src/buildstream/_loader/loadelement.py b/src/buildstream/_loader/loadelement.py
index 673bc50ee..773675e2b 100644
--- a/src/buildstream/_loader/loadelement.py
+++ b/src/buildstream/_loader/loadelement.py
@@ -22,8 +22,6 @@ from itertools import count
from pyroaring import BitMap, FrozenBitMap # pylint: disable=no-name-in-module
-from .. import _yaml
-
# LoadElement():
#
@@ -81,7 +79,7 @@ class LoadElement():
self.full_name = self.name
# Ensure the root node is valid
- _yaml.node_validate(self.node, [
+ self.node.validate_keys([
'kind', 'depends', 'sources', 'sandbox',
'variables', 'environment', 'environment-nocache',
'config', 'public', 'description',
diff --git a/src/buildstream/_loader/types.pyx b/src/buildstream/_loader/types.pyx
index 3a415afc9..5b8388e28 100644
--- a/src/buildstream/_loader/types.pyx
+++ b/src/buildstream/_loader/types.pyx
@@ -79,10 +79,10 @@ cdef class Dependency:
elif type(dep) is _yaml.MappingNode:
if default_dep_type:
- _yaml.node_validate(<_yaml.Node> dep, ['filename', 'junction'])
+ (<_yaml.MappingNode> dep).validate_keys(['filename', 'junction'])
dep_type = default_dep_type
else:
- _yaml.node_validate(<_yaml.Node> dep, ['filename', 'type', 'junction'])
+ (<_yaml.MappingNode> dep).validate_keys(['filename', 'type', 'junction'])
# Make type optional, for this we set it to None
dep_type = (<_yaml.MappingNode> dep).get_str(<str> Symbol.TYPE, None)