Puppet: System Administration Automated

Support

Ticket #660 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

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

Reported by: freiheit Assigned to: luke
Priority: normal Milestone:
Component: server Version: 0.22.4
Severity: normal Keywords: network spaces generate
Cc: eric.eisenhart@sonoma.edu Triage Stage: Unreviewed
Attached Patches: None Complexity: Unknown

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.

Attachments

yaml-folding.ugly.patch (463 bytes) - added by freiheit on 06/11/07 18:15:35.
Ugly patch which works around this problem
yaml-folding.prettier.patch (0.6 kB) - added by freiheit on 06/11/07 20:39:19.
Patch that's not quite so ugly…

Change History

06/09/07 01:39:01 changed by freiheit

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.

06/11/07 18:15:35 changed by freiheit

  • attachment yaml-folding.ugly.patch added.

Ugly patch which works around this problem

06/11/07 18:18:44 changed by freiheit

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...

06/11/07 20:39:19 changed by freiheit

  • attachment yaml-folding.prettier.patch added.

Patch that's not quite so ugly...

06/11/07 23:13:40 changed by luke

  • status changed from new to closed.
  • resolution set to fixed.

Applied in [2560].