diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-28 17:36:33 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | 7b9a478868ba7a2a1f5b49142496d0eb77322e21 (patch) | |
tree | a7e99ac0e5c43ad31be73d6df8489371e1e395ac /src/buildstream/_workspaces.py | |
parent | 06faf60f47d270bc9ce3c6945c31861302882ae9 (diff) | |
download | buildstream-7b9a478868ba7a2a1f5b49142496d0eb77322e21.tar.gz |
_yaml: remove node_sanitize
Some call places do not need calls to 'node_sanitize' anymore, therefore
removing the call entirely.
Other still use it for convenience, but that doesn't seem the right way
to do it for consistency. Those places have been replaced by calls to
'Node.strip_node_info()'.
Diffstat (limited to 'src/buildstream/_workspaces.py')
-rw-r--r-- | src/buildstream/_workspaces.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/buildstream/_workspaces.py b/src/buildstream/_workspaces.py index ed50828a3..d3a28b879 100644 --- a/src/buildstream/_workspaces.py +++ b/src/buildstream/_workspaces.py @@ -114,7 +114,8 @@ class WorkspaceProject(): def load(cls, directory): workspace_file = os.path.join(directory, WORKSPACE_PROJECT_FILE) if os.path.exists(workspace_file): - data_dict = _yaml.node_sanitize(_yaml.roundtrip_load(workspace_file), dict_type=dict) + data_dict = _yaml.roundtrip_load(workspace_file) + return cls.from_dict(directory, data_dict) else: return None @@ -627,13 +628,15 @@ class Workspaces(): # (Workspace): A newly instantiated Workspace # def _load_workspace(self, node): + running_files = node.get_mapping('running_files', default=None) + if running_files: + running_files = running_files.strip_node_info() + dictionary = { 'prepared': node.get_bool('prepared', default=False), 'path': node.get_str('path'), 'last_successful': node.get_str('last_successful', default=None), - 'running_files': _yaml.node_sanitize( - node.get_mapping('running_files', default=None), - dict_type=dict), + 'running_files': running_files, } return Workspace.from_dict(self._toplevel_project, dictionary) |