diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-03 10:28:50 +0100 |
---|---|---|
committer | Benjamin Schubert <contact@benschubert.me> | 2019-07-03 16:57:25 +0000 |
commit | f05f91725db54c62f79be11ea890f1ed5556db00 (patch) | |
tree | 8d914a3748c5c926e383b1a9689c8b3709f4e662 /src | |
parent | b4b0f79f6e09a89f1eee785702f47e5975e41bf7 (diff) | |
download | buildstream-f05f91725db54c62f79be11ea890f1ed5556db00.tar.gz |
_yaml: Add a 'from_dict' on Node to create new nodes from dicts
This new methods is here to replace the previous 'new_node_from_dict'
that will be moved to a private method.
Adapt all call sites to use the new 'from_dict' method.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildstream/_yaml.pyx | 4 | ||||
-rw-r--r-- | src/buildstream/element.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/buildstream/_yaml.pyx b/src/buildstream/_yaml.pyx index 6420474eb..a142fdfcb 100644 --- a/src/buildstream/_yaml.pyx +++ b/src/buildstream/_yaml.pyx @@ -69,6 +69,10 @@ cdef class Node: self.line = line self.column = column + @classmethod + def from_dict(cls, dict value): + return new_node_from_dict(value) + cdef bint _walk_find(self, Node target, list path) except *: raise NotImplementedError() diff --git a/src/buildstream/element.py b/src/buildstream/element.py index a4496e192..770f5df42 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -2633,7 +2633,7 @@ class Element(Plugin): @classmethod def __extract_sandbox_config(cls, project, meta): if meta.is_junction: - sandbox_config = _yaml.new_node_from_dict({ + sandbox_config = _yaml.Node.from_dict({ 'build-uid': 0, 'build-gid': 0 }) |