Issue #5261 has been updated by Chris May.

Just to be clear, the exact error I get on the master with 2.6.3 is 

<pre>
 Could not render to pson: "\355\274\267"
</pre>

 - slightly different wording to before, but I guess the intent is the same.
----------------------------------------
Feature #5261: Need a way to transmit binary data for file contents in manifests
https://projects.puppetlabs.com/issues/5261

Author: Chris May
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


In puppet 0.25.x and up (i.e. any configuration that uses the ReST API), it 
does not appear possible to supply arbitrary binary data in the "content" 
attribute of a file resource. For example, doing this

<pre>
file{"/path/to/key.jks": content=>file("/secrets/key.jks") }
</pre>

will fail if /secrets/key.jks contains any non-UTF-8 characters. Depending on 
the specific version, the error will be something like

<pre>
Could not render to pson: Caught Iconv::IllegalSequence: "\355\262\225"
</pre>
or
<pre>
Could not render to pson: invalid utf8 byte: '\176'
</pre>

This issue was discussed in http://projects.puppetlabs.com/issues/4832, in 
which Felix Frank said "So there’s a design decision after all: If PSON is to 
be JSON compatible – no binary data.". I take this to mean that content=>file() 
is not intended to be used with non-UTF-8 data. 

In that case, would it be possible to have an alternative, binary-safe version 
of file() (or a binary-content attribute for the file resource) which could 
base-64 encode content before transmission, and decode it on the client? 

There's some further discussion on the puppet-users group 
here:http://groups.google.com/group/puppet-users/browse_thread/thread/194625e4e453ecb4



-- 
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://projects.puppetlabs.com/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.

Reply via email to