summaryrefslogtreecommitdiff
path: root/src/buildstream/source.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-07-08 14:18:39 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:03 +0000
commit099e3ebf3aad424be2f3488aef9d9d961b700483 (patch)
treeb1634644122751537e092caf8c35f8a1cee6cf9b /src/buildstream/source.py
parent695eddc069c9803eca5d004e80ca7be7defdd20c (diff)
downloadbuildstream-099e3ebf3aad424be2f3488aef9d9d961b700483.tar.gz
_yaml: Remove 'node_get_provenance' and add 'Node.get_provenance'
This replaces the helper method by adding a 'get_provenance' on the node directly - Adapt all call sites - Delay getting provenance wherever possible without major refactor
Diffstat (limited to 'src/buildstream/source.py')
-rw-r--r--src/buildstream/source.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildstream/source.py b/src/buildstream/source.py
index 855045040..5125169e8 100644
--- a/src/buildstream/source.py
+++ b/src/buildstream/source.py
@@ -307,7 +307,7 @@ class Source(Plugin):
"""
def __init__(self, context, project, meta, *, alias_override=None, unique_id=None):
- provenance = _yaml.node_get_provenance(meta.config)
+ provenance = meta.config.get_provenance()
super().__init__("{}-{}".format(meta.element_name, meta.element_index),
context, project, provenance, "source", unique_id=unique_id)
@@ -955,9 +955,9 @@ class Source(Plugin):
for key, action in actions.items():
# Obtain the top level node and its file
if action == 'add':
- provenance = _yaml.node_get_provenance(node)
+ provenance = node.get_provenance()
else:
- provenance = _yaml.node_get_provenance(node, key=key)
+ provenance = node.get_node(key).get_provenance()
toplevel_node = provenance.toplevel