summaryrefslogtreecommitdiff
path: root/src/buildstream/_includes.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-25 20:27:15 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:03 +0000
commit42d3d8406a15cd5f6f4a7d00e298dba019a50ed6 (patch)
tree7165dafdc3707faf4e71fba8c81d5752fd4668d8 /src/buildstream/_includes.py
parented2dde6110a5f9087ff3596df9d86ba5468dcac8 (diff)
downloadbuildstream-42d3d8406a15cd5f6f4a7d00e298dba019a50ed6.tar.gz
_yaml: Introduce 'MappingNode.values()'
This is to mimic the 'dict.values()' interface. - Adapt parts of the code calling 'node_items' but ignoring the first value to use this instead
Diffstat (limited to 'src/buildstream/_includes.py')
-rw-r--r--src/buildstream/_includes.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/buildstream/_includes.py b/src/buildstream/_includes.py
index f63e56213..ea2bf484e 100644
--- a/src/buildstream/_includes.py
+++ b/src/buildstream/_includes.py
@@ -83,7 +83,7 @@ class Includes:
_yaml.composite_and_move(node, include_node)
- for _, value in _yaml.node_items(node):
+ for value in node.values():
self._process_value(value,
included=included,
current_loader=current_loader,
@@ -129,12 +129,14 @@ class Includes:
included=set(),
current_loader=None,
only_local=False):
- if _yaml.is_node(value):
+ value_type = type(value)
+
+ if value_type is _yaml.MappingNode:
self.process(value,
included=included,
current_loader=current_loader,
only_local=only_local)
- elif isinstance(value, list):
+ elif value_type is _yaml.SequenceNode:
for v in value:
self._process_value(v,
included=included,