diff options
-rwxr-xr-x | doc/bst2html.py | 2 | ||||
-rw-r--r-- | src/buildstream/_artifact.py | 2 | ||||
-rw-r--r-- | src/buildstream/_stream.py | 2 | ||||
-rw-r--r-- | src/buildstream/_workspaces.py | 4 | ||||
-rw-r--r-- | src/buildstream/_yaml.pyx | 15 | ||||
-rw-r--r-- | tests/format/include.py | 4 |
6 files changed, 7 insertions, 22 deletions
diff --git a/doc/bst2html.py b/doc/bst2html.py index 9d178bc18..71d497eda 100755 --- a/doc/bst2html.py +++ b/doc/bst2html.py @@ -197,7 +197,7 @@ def workdir(source_cache=None): 'sourcedir': source_cache, 'logdir': os.path.join(tempdir, 'logs'), } - _yaml.dump(config, bst_config_file) + _yaml.roundtrip_dump(config, bst_config_file) yield (tempdir, bst_config_file, source_cache) diff --git a/src/buildstream/_artifact.py b/src/buildstream/_artifact.py index ec574e335..4e7fa4911 100644 --- a/src/buildstream/_artifact.py +++ b/src/buildstream/_artifact.py @@ -147,7 +147,7 @@ class Artifact(): # Store public data with utils._tempnamedfile_name(dir=self._tmpdir) as tmpname: - _yaml.dump(publicdata, tmpname) + _yaml.roundtrip_dump(publicdata, tmpname) public_data_digest = self._cas.add_object(path=tmpname, link_directly=True) artifact.public_data.CopyFrom(public_data_digest) size += public_data_digest.size_bytes diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index 705e0a5d3..3c32ff616 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -930,7 +930,7 @@ class Stream(): } workspaces.append(workspace_detail) - _yaml.dump({ + _yaml.roundtrip_dump({ 'workspaces': workspaces }) diff --git a/src/buildstream/_workspaces.py b/src/buildstream/_workspaces.py index 95c1817ce..ed50828a3 100644 --- a/src/buildstream/_workspaces.py +++ b/src/buildstream/_workspaces.py @@ -125,7 +125,7 @@ class WorkspaceProject(): # def write(self): os.makedirs(self._directory, exist_ok=True) - _yaml.dump(self.to_dict(), self.get_filename()) + _yaml.roundtrip_dump(self.to_dict(), self.get_filename()) # get_filename() # @@ -530,7 +530,7 @@ class Workspaces(): } } os.makedirs(self._bst_directory, exist_ok=True) - _yaml.dump(config, self._get_filename()) + _yaml.roundtrip_dump(config, self._get_filename()) # _load_config() # diff --git a/src/buildstream/_yaml.pyx b/src/buildstream/_yaml.pyx index 365615b73..81c456932 100644 --- a/src/buildstream/_yaml.pyx +++ b/src/buildstream/_yaml.pyx @@ -833,21 +833,6 @@ cpdef Node load_data(str data, int file_index=_SYNTHETIC_FILE_INDEX, str file_na return contents -# dump() -# -# Write a YAML node structure out to disk. -# -# This will always call `node_sanitize` on its input, so if you wanted -# to output something close to what you read in, consider using the -# `roundtrip_load` and `roundtrip_dump` function pair instead. -# -# Args: -# contents (any): Content to write out -# filename (str): The (optional) file name to write out to -def dump(object contents, str filename=None): - roundtrip_dump(node_sanitize(contents), file=filename) - - # node_get_provenance() # # Gets the provenance for a node diff --git a/tests/format/include.py b/tests/format/include.py index 3bb4e4d51..8902aa3eb 100644 --- a/tests/format/include.py +++ b/tests/format/include.py @@ -35,7 +35,7 @@ def test_include_missing_file(cli, tmpdir): tmpdir.join('project.conf').write('{"name": "test"}') element = tmpdir.join('include_missing_file.bst') - # Normally we would use dicts and _yaml.dump to write such things, but here + # Normally we would use dicts and _yaml.roundtrip_dump to write such things, but here # we want to be sure of a stable line and column number. element.write(textwrap.dedent(""" kind: manual @@ -55,7 +55,7 @@ def test_include_dir(cli, tmpdir): tmpdir.mkdir('subdir') element = tmpdir.join('include_dir.bst') - # Normally we would use dicts and _yaml.dump to write such things, but here + # Normally we would use dicts and _yaml.roundtrip_dump to write such things, but here # we want to be sure of a stable line and column number. element.write(textwrap.dedent(""" kind: manual |