summaryrefslogtreecommitdiff
path: root/src/buildstream/_project.py
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-25 17:51:36 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:02 +0000
commita275c823f07fb6d737ba7288056abce1599eecec (patch)
treeed159afda3e837535c08d916577f615049d479f0 /src/buildstream/_project.py
parentbb3c8045cd89a7c4d1d7cd2e03736496dd449fb9 (diff)
downloadbuildstream-a275c823f07fb6d737ba7288056abce1599eecec.tar.gz
_yaml: Remove 'node_del' and support `del mapping[key]`
- Also add a convenience method 'safe_del' catching the exception when we don't care if the value was there or not.
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 b53787b17..e1e873858 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -753,8 +753,8 @@ class Project():
# assertion after.
output.element_overrides = config.get_mapping('elements', default={})
output.source_overrides = config.get_mapping('sources', default={})
- _yaml.node_del(config, 'elements', safe=True)
- _yaml.node_del(config, 'sources', safe=True)
+ config.safe_del('elements')
+ config.safe_del('sources')
_yaml.node_final_assertions(config)
self._load_plugin_factories(config, output)
@@ -943,7 +943,7 @@ class Project():
_yaml.node_set(origin_node, 'plugins', [k for k in _yaml.node_keys(plugins)])
for group in expected_groups:
if group in origin_node:
- _yaml.node_del(origin_node, group)
+ del origin_node[group]
if origin_node.get_str('origin') == 'local':
path = self.get_path_from_node(origin, 'path',