Bug #660

generate() and template() results with multiple long lines gets spaces substituted at 80-char intervals

Added by Eric Eisenhart almost 5 years ago. Updated almost 5 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:Luke Kanies % Done:

0%

Category:-
Target version:-
Affected Puppet version:0.25.4 Branch:
Keywords:
Votes: 0

Description

This only happens when puppetmasterd is involved. If I use puppet direct to test everything works fine.

Some sort of 80char line-length limit?

Possibly related to #564

Manifest: file { “/tmp/test.authorized_keys”: content => generate(“/tmp/test.sh”) }

Shell script in /tmp/test.sh:

!/bin/sh

echo ‘#’ echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

The B in the above gets replaced with a space; note that it’s the 81st character.

I also tried doing the same thing via a template: <%= %x{/tmp/test.sh} %>

And I get the same problem.

Duplicated results with a current (as of earlier today) svn checkout of the puppetmaster.

yaml-folding.ugly.patch (463 Bytes) Eric Eisenhart, 06/11/2007 06:15 pm

yaml-folding.prettier.patch (621 Bytes) Eric Eisenhart, 06/11/2007 08:39 pm

History

Updated by Eric Eisenhart almost 5 years ago

Oh, forgot to mention: adding some data and a space to the beginning of the output and the space-replacement stays where the B is — seems to be something look for 80char or shorter lengths of non-whitespace.

Updated by Eric Eisenhart almost 5 years ago

The bug appears to be somewhere in the YAML stuff; possibly it’s really a bug in the ruby YAML in RHEL4 more than in puppet itself… This could be an incompatibility between different versions of ruby (1.8.1 and 1.8.5 in this case) in the YAML module. From what I can tell, multi-line items inside of YAML get folded, and the folding is broken.

Anyways, changing the default fold width to 1MiB seems to fix the problem…

Updated by Luke Kanies almost 5 years ago

  • Status changed from 1 to Closed
  • 7 set to fixed

Applied in r2560.

Also available in: Atom PDF