summaryrefslogtreecommitdiff
path: root/src/buildstream/plugin.py
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-10 14:20:23 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-15 14:14:02 +0000
commitd14b809cc7b56b7be9e3e40c2e12e8f7245ba680 (patch)
tree3afa82437bb3dcda6b63979c88c20d70f8dfd4f4 /src/buildstream/plugin.py
parent38671fb53f4522d046bed94699db8cc344ac2862 (diff)
downloadbuildstream-d14b809cc7b56b7be9e3e40c2e12e8f7245ba680.tar.gz
_yaml: Add 'as_bool()' and 'is_none()' to ScalarNode
- 'as_bool()' casts a ScalarNode into a boolean, understanding both 'True' and 'False' as truthy-falsy values, as per node_get(type=bool) behavior - 'is_none()' allwos checking whether the scalar node contains a 'None' value. Since 'None' cannot be used when working with booleans, we need to have a way of checking for 'None' when we actually need the information of whether the value is unset. - Adapt all call places to use the new API
Diffstat (limited to 'src/buildstream/plugin.py')
-rw-r--r--src/buildstream/plugin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py
index de969c267..007db4930 100644
--- a/src/buildstream/plugin.py
+++ b/src/buildstream/plugin.py
@@ -894,10 +894,10 @@ class Plugin():
project = self.__project
for key, value in self.node_items(project.element_overrides):
- if _yaml.node_get(value, bool, 'suppress-deprecation-warnings', default_value=False):
+ if value.get_bool('suppress-deprecation-warnings', default=False):
silenced_warnings.add(key)
for key, value in self.node_items(project.source_overrides):
- if _yaml.node_get(value, bool, 'suppress-deprecation-warnings', default_value=False):
+ if value.get_bool('suppress-deprecation-warnings', default=False):
silenced_warnings.add(key)
return self.get_kind() in silenced_warnings