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
committerBenjamin Schubert <contact@benschubert.me>2019-06-25 21:08:50 +0100
commitb68b6d14564584df0da60f41483021568bd91b91 (patch)
tree523b568c450545d27a995b0b2354566697103eba /src/buildstream/plugin.py
parente62347655a5445a621701b6e13c7abd813d954c9 (diff)
downloadbuildstream-b68b6d14564584df0da60f41483021568bd91b91.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 a12ff61ec..e209e5f4e 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