summaryrefslogtreecommitdiff
path: root/tests/sources/previous_source_access
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-10 07:51:57 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:02 +0000
commit38671fb53f4522d046bed94699db8cc344ac2862 (patch)
treedc75c432d897d393d3a568290d45d762c7bde093 /tests/sources/previous_source_access
parentfcef3658433f74a2f396ed353bb3534f0001f3d8 (diff)
downloadbuildstream-38671fb53f4522d046bed94699db8cc344ac2862.tar.gz
_yaml: Add 'as_str()' on ScalarNode and 'get_scalar()' on MappingNode
- 'get_scalar()' allows retrieving a scalar node from a mapping. - 'as_str()' casts a ScalarNode into a string (thus removing the node information). Both together, those replace 'node_get(mapping, key, type=str)' but also allow retrieving the 'Node' itself, which will allow in the future lazier provenance computation.
Diffstat (limited to 'tests/sources/previous_source_access')
-rw-r--r--tests/sources/previous_source_access/plugins/sources/foo_transform.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/sources/previous_source_access/plugins/sources/foo_transform.py b/tests/sources/previous_source_access/plugins/sources/foo_transform.py
index bec4f9913..cd0f621d5 100644
--- a/tests/sources/previous_source_access/plugins/sources/foo_transform.py
+++ b/tests/sources/previous_source_access/plugins/sources/foo_transform.py
@@ -32,7 +32,7 @@ class FooTransformSource(Source):
def configure(self, node):
self.node_validate(node, ['ref', *Source.COMMON_CONFIG_KEYS])
- self.ref = self.node_get_member(node, str, 'ref', None)
+ self.ref = node.get_str('ref', None)
def preflight(self):
pass