summaryrefslogtreecommitdiff
path: root/src/buildstream/plugins/elements/junction.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-10 07:51:57 +0100
committerBenjamin Schubert <contact@benschubert.me>2019-06-25 21:08:50 +0100
commite62347655a5445a621701b6e13c7abd813d954c9 (patch)
treef540b7c280ae29257fa130d61fc87befa0372282 /src/buildstream/plugins/elements/junction.py
parentfe0cdcb252b880995163f24b37a7a076cdf7824a (diff)
downloadbuildstream-e62347655a5445a621701b6e13c7abd813d954c9.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 'src/buildstream/plugins/elements/junction.py')
-rw-r--r--src/buildstream/plugins/elements/junction.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildstream/plugins/elements/junction.py b/src/buildstream/plugins/elements/junction.py
index 849df72be..d30e34828 100644
--- a/src/buildstream/plugins/elements/junction.py
+++ b/src/buildstream/plugins/elements/junction.py
@@ -175,9 +175,9 @@ class JunctionElement(Element):
BST_FORBID_RDEPENDS = True
def configure(self, node):
- self.path = self.node_get_member(node, str, 'path', default='')
+ self.path = node.get_str('path', default='')
self.options = node.get_mapping('options', default={})
- self.target = self.node_get_member(node, str, 'target', default=None)
+ self.target = node.get_str('target', default=None)
self.target_element = None
self.target_junction = None