Issue #1679 has been updated by ohookins.
OK here we go:
/tmp/puppet/test.pp:
<pre>
file { "/tmp/puppet/link^M":
ensure => "/tmp/puppet/test.pp";
}
</pre>
Run through "puppet -d -v test.pp" results in:
<pre>
[EMAIL PROTECTED]:/tmp/puppet# ls -la
total 4
drwxr-xr-x 2 root root 80 2008-10-31 12:00 .
drwxrwxrwt 17 root root 420 2008-10-31 12:00 ..
lrwxrwxrwx 1 root root 19 2008-10-31 12:00 link? -> /tmp/puppet/test.pp
-rw-r--r-- 1 root root 64 2008-10-31 12:00 test.pp
</pre>
All looks good here. I then inserted the exact same file resource into the node
config on my staging server, and ran "puppetd --onetime --no-daemonize
--ignorecache -d -v" on the node:
<pre>
debug: //Node[captain]/File[/tmp/puppet/link]: File does not exist
debug: //Node[captain]/File[/tmp/puppet/link]: Changing ensure
debug: //Node[captain]/File[/tmp/puppet/link]: 1 change(s)
debug: //Node[captain]/File[/tmp/puppet/link]/mode: Not managing symlink mode
notice: //Node[captain]/File[/tmp/puppet/link]/ensure: created
</pre>
The filesystem shows:
<pre>
[EMAIL PROTECTED]:/tmp/puppet# ls -la
total 4
drwxr-xr-x 2 root root 80 2008-10-31 12:08 .
drwxrwxrwt 17 root root 440 2008-10-31 12:08 ..
lrwxrwxrwx 1 root root 19 2008-10-31 12:08 link -> /tmp/puppet/test.pp
-rw-r--r-- 1 root root 64 2008-10-31 12:00 test.pp
</pre>
No ^M !
In the XMLRPC conversation the ^M seems to be encoded in
%2Ftmp%2Fpuppet%2Flink%0D (there's a %0A after that, as usual for the endline).
So, the puppetmasterd appears to be transmitting the carriage return (%0D)
properly to the client. Beyond that I cannot hypothesize, as I'm not familiar
with puppet internals enough yet.
----------------------------------------
Bug #1679: Control characters can't be used within a file resource
http://projects.reductivelabs.com/issues/show/1679
Author: ohookins
Status: Accepted
Priority: Normal
Assigned to: community
Category: file
Target version: unplanned
Complexity: Unknown
Affected version: 0.24.5
Keywords:
Our use case is thus: occasionally users will copy perl scripts over to our
Linux machines from a Windows machine, unchanged, resulting in carriage return
characters on the end of the line. Therefore the shebang might end up looking
like this:
<pre>
#!/usr/bin/perl^M
</pre>
where the ^M is a carriage return character (you can get this in Vi by typing
^V^M). To alleviate problems with these scripts we usually create a few links:
/usr/bin/perl^M -> /usr/bin/perl
/usr/local/bin/perl^M -> /usr/bin/perl
etc.
If you attempt to put the control character ^M into the manifest to create the
link, it is ignored (or stripped out) by puppet and we end up over-writing
/usr/bin/perl with an invalid link to itself.
<pre>
file { "/usr/bin/perl^M":
ensure => "/usr/bin/perl";
}
</pre>
For the moment I've had to resort to execs to get the job done (which
unfortunately still messes with puppet's debug output due to the ^M) but it
would be nice if puppet could handle the control character natively.
----------------------------------------
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---