diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-10 14:20:23 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:02 +0000 |
commit | d14b809cc7b56b7be9e3e40c2e12e8f7245ba680 (patch) | |
tree | 3afa82437bb3dcda6b63979c88c20d70f8dfd4f4 /src/buildstream/plugins/sources | |
parent | 38671fb53f4522d046bed94699db8cc344ac2862 (diff) | |
download | buildstream-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/plugins/sources')
-rw-r--r-- | src/buildstream/plugins/sources/remote.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buildstream/plugins/sources/remote.py b/src/buildstream/plugins/sources/remote.py index 4e9fe4f7d..bb4c11325 100644 --- a/src/buildstream/plugins/sources/remote.py +++ b/src/buildstream/plugins/sources/remote.py @@ -63,7 +63,7 @@ class RemoteSource(DownloadableFileSource): super().configure(node) self.filename = node.get_str('filename', os.path.basename(self.url)) - self.executable = self.node_get_member(node, bool, 'executable', False) + self.executable = node.get_bool('executable', default=False) if os.sep in self.filename: raise SourceError('{}: filename parameter cannot contain directories'.format(self), |