-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yaml_dquote adds whitespace when string > 80 chars long #34181
Comments
@pykler looks like i'm able to replicate this behavior:
|
One solution is to initialize the Emitter with maxint as the line width salt/salt/utils/yamlencoding.py Line 19 in 0ef623f
http://pyyaml.org/browser/pyyaml/trunk/lib/yaml/emitter.py#L38
|
For anyone interested in a quick and dirty solution, in the jinja files I replaced newlines as follows. Note that this only works if your original string has no newlines, if you actually need the original newlines only your probably SOL until this is resolved. Though, I do not think there is a usecase like that where you would want some of the newlines.
Notice the extra escaped backslash. |
Fixes #34181 no more newlines in long yaml encodes
* upstream/develop: (37 commits) Use ipaddress to validate ipv4/ipv6 (saltstack#33956) Updated winrepo_test (saltstack#34227) Whitespace fix for saltstack#34235 (saltstack#34250) message_format was not set in the correct function (saltstack#34235) Typo in dockerio doc (saltstack#34244) Fixup test failure Pass through update_holds to pkg.install fix regression from saltstack#33681 which causes pulling a list of s3 objects via s3.query to fail (saltstack#34208) fix regression in s3.query from saltstack#33599 that causes pulling a file list from s3 to fail (saltstack#34207) utils/parsers.py: disable minion multiprocessing logging if only running one process Fix a pair of gitfs bugs (saltstack#34218) rsync state: Removed source existance check saltstack#25251 Linted saltstack#34200 Allow specifying memory, cpu and vcpu as kwargs for OpenNebula (saltstack#34203) Fixes saltstack#34181 no more newlines in long yaml encodes Clarify pkg.list_repo_pkgs docstring for held packages (saltstack#34188) Update saltutil.wheel docs to specify remote vs local minion behavior fix regression in s3.query from saltstack#33682 Change target for dockerng assuming default status to Nitrogen release (saltstack#34206) Correct the docstrings formatting in pkgbuild modules and state (saltstack#34194) ...
Description of Issue/Question
yaml_dquote filter uses the basic yaml Emitter which adds a Emitter.best_line_break when Emitter.column > Emitter.best_width (+ some additional yaml criteria). This works for yaml but doesnt work when using these strings inside sls files.
Setup
Steps to Reproduce Issue
Execute the above sls, you will notice a newline is inserted before the last double quote.
Versions Report
The text was updated successfully, but these errors were encountered: