Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 4.10.9, PUP 5.3.3
-
None
-
None
-
-
Platform Core
-
Customer Feedback
-
Major
-
3 - 25-50% of Customers
-
3 - Serious
-
5 - $$$$$$
-
This bug makes it extremely difficult or impossible for customers to use templates to create files for windows systems with the correct CRLF line endings.
-
Known Issue
-
EPP templates containing CRLF line breaks did not generate files containing CRLF line breaks, which is the expected result and also the result when using CRLF line breaks in ERB templates. This is now corrected.
-
Needs Assessment
Description
Via williams.geoff on DOCUMENT-779:
expected result
When applying a puppet manifest and its EPP template using CRLF line endings to generate a file, the generated file should also use CRLF line endings.
When using a CRLF escape sequence in ERB or EPP templates (\r\n), Puppet should replace the sequence with a CRLF line ending in the generated file.
This is documented at Handling line endings on Resource tips and Examples: File on Windows:
- If a file resource uses the content or source attributes, Puppet will write the file in “binary” mode, using whatever line endings are present in the content.
- If the manifest, template, or source file is saved with CRLF line endings, Puppet will use those endings in the destination file.
- If the manifest, template, or source file is saved with LF line endings, you can use the \r\n escape sequence to create literal CRLFs.
actual result
Following the instructions produces one long line of text instead of text with CRLF line breaks, and \r\n appears literally in the output instead of being replaced with a CRLF line break.
test case
test.pp:
file { "c:/test.txt":
|
content => epp("c:/test.epp")
|
}
|
test.epp:
line 1
|
line 2
|
:P
|
test.txt (result)
line 1line 2:P
|
Files were created in notepad to get the line endings. See the attachment.
Escape codes in the template:
test.epp:
line 1\r\n
|
line 2\r\n
|
:P\r\n
|
test.txt output:
line 1\r\nline 2\r\n:P\r\n
|
How to run testcase (save to c:):
puppet apply c:\test.pp
|
workaround
Traditional erb templates' template() handle CRLF line endings as documented and expected, although these also result in literal \r\n in the output, which still conflicts with the documentation.
Attachments
Issue Links
- causes
-
DOCUMENT-779 Line ending documentation on file resources for windows is inaccurate
-
- Closed
-
- relates to
-
PUP-927 puppet apply on Windows always uses *nix style newlines from templates
-
- Closed
-
- mentioned in
-
Page Loading...