pegleg/pegleg/engine
Felipe Monteiro 18598b671b fix: Stop adding unwanted newlines in multiline strings
This patch set fixes a `pegleg site render` issue in which pyyaml
is adding unwanted (multiple) newlines in multiline strings in the
output. In other words, currently, `pegleg site render` keeps injecting
additional newline characters in multiline certificates, such that
each newline is rendered, in effect, as two newlines.

For example:

  -----BEGIN CERTIFICATE-----
  MIIDSDCCAjCgAwIBAgIUegkh/antB1XyDVHdP5dv+0MZyBcwDQYJKoZIhvcNAQEL
  BQAwKjETMBEGA1UEChMKS3ViZXJuZXRlczETMBEGA1UEAxMKa3ViZXJuZXRlczAe
  <snip>

Currently renders as:

  -----BEGIN CERTIFICATE-----

  MIIDSDCCAjCgAwIBAgIUegkh/antB1XyDVHdP5dv+0MZyBcwDQYJKoZIhvcNAQEL

  BQAwKjETMBEGA1UEChMKS3ViZXJuZXRlczETMBEGA1UEAxMKa3ViZXJuZXRlczAe
  <snip>

This patch set adds code to pegleg.engine.__init__ to use the
solution prescribed in [0] to force pyyaml to ensure that the
rendered output for such multiline strings matches the original
input.

Note that this requires using safe_dump(_all) which should be
used in Pegleg ubiquitously for the same reason as [1]. Using
safe_dump(_all) for all CLI actions will be done in a follow up
change.

[0] https://stackoverflow.com/questions/45004464/yaml-dump-adding-unwanted-newlines-in-multiline-strings
[1] https://review.openstack.org/#/c/578240/

Change-Id: I3d53b310869e5eacf3d7a17b51ff9ae462d64736
2018-10-10 21:52:29 +00:00
..
util Merge "CLI: Add support for listing repository types" 2018-10-09 15:50:02 +00:00
__init__.py fix: Stop adding unwanted newlines in multiline strings 2018-10-10 21:52:29 +00:00
errorcodes.py Standardize Pegleg directory structure 2018-09-23 10:33:40 -04:00
exceptions.py Standardize Pegleg directory structure 2018-09-23 10:33:40 -04:00
lint.py Implement global lint and lint by site logic 2018-10-02 21:41:56 +01:00
repository.py fix: Allow -r flag to work with remote repository URLs 2018-09-27 14:27:47 +01:00
site.py Add explicit start/end to pegleg site render output 2018-09-24 21:37:37 +01:00
type.py CLI: Add support for listing repository types 2018-10-04 19:30:13 +01:00