diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-27 11:18:20 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | 1d970eef4be03909873ed9fa16748e8248238127 (patch) | |
tree | ad4f7d0e6bbd5027d87b872ee96094a923205db6 /src/buildstream/source.py | |
parent | 8bfe8dd6ad49445c900662f304072eb20f0ff606 (diff) | |
download | buildstream-1d970eef4be03909873ed9fa16748e8248238127.tar.gz |
_yaml: Remove 'key' from node_find_target
- node_find_target with 'key' is only used once in the codebase.
We can remove and simplify this function
- Allow 'MappingNode.get_node()' to be called without any
'expected_types'
Diffstat (limited to 'src/buildstream/source.py')
-rw-r--r-- | src/buildstream/source.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/buildstream/source.py b/src/buildstream/source.py index 828d05017..89655e15b 100644 --- a/src/buildstream/source.py +++ b/src/buildstream/source.py @@ -964,7 +964,9 @@ class Source(Plugin): if action == 'add': path = _yaml.node_find_target(toplevel_node, node) else: - path = _yaml.node_find_target(toplevel_node, node, key=key) + full_path = _yaml.node_find_target(toplevel_node, node.get_node(key)) + # We want the path to the node containing the key, not to the key + path = full_path[:-1] roundtrip_file = roundtrip_cache.get(provenance.filename) if not roundtrip_file: |