summaryrefslogtreecommitdiff
path: root/src/buildstream/_project.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-25 21:14:40 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:03 +0000
commit1aa0fb1fefa7e86586831a13200a92f6dd9bd3b4 (patch)
tree8e675fc215ab9f1fcf8851470c95c0e2039f42ee /src/buildstream/_project.py
parent42d3d8406a15cd5f6f4a7d00e298dba019a50ed6 (diff)
downloadbuildstream-1aa0fb1fefa7e86586831a13200a92f6dd9bd3b4.tar.gz
_yaml: Remove 'node_items' and add 'MappingNode.items()'
One difference is that 'MappingNode.items()' does not strip the provenance from scalars and lists, which ends up not affecting the code much.
Diffstat (limited to 'src/buildstream/_project.py')
-rw-r--r--src/buildstream/_project.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index e5c0ad21a..3c82ac245 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -815,9 +815,9 @@ class Project():
_yaml.node_validate(mirror, allowed_mirror_fields)
mirror_name = mirror.get_str('name')
alias_mappings = {}
- for alias_mapping, uris in _yaml.node_items(mirror.get_mapping('aliases')):
- assert isinstance(uris, list)
- alias_mappings[alias_mapping] = list(uris)
+ for alias_mapping, uris in mirror.get_mapping('aliases').items():
+ assert type(uris) is _yaml.SequenceNode # pylint: disable=unidiomatic-typecheck
+ alias_mappings[alias_mapping] = uris.as_str_list()
output.mirrors[mirror_name] = alias_mappings
if not output.default_mirror:
output.default_mirror = mirror_name