On 09/30/2010 04:26 PM, Markus Roberts wrote:
> ...
> We aren't communicating.
I just realized that. Sorry for being dense.
> PSON is how the puppet master exchanges data with the agents. No one needs
> to hand code the PSON, it is produced and consumed by software on both
> ends. And by design it is capable of expressing arbitrary binary data (that
> is, any data that you want) in appropriate contexts and so should not impose
> a limitation on what you can or can't send. If it doesn't work this way we
> would consider it a bug.
I most certainly do (now).
>> This is what puppetmaster 0.25.5 will throw at me when the client
>> requests PSON serialization:
>> puppetmasterd[5384]: Could not render to pson: invalid utf8 byte: '�'
>>
>> (That next to last character is supposed to be a ? glyph, but it doesn't
>> really matter).
>>
>> Serialization fails for such manifests and puppetd cannot run.
>>
>> I haven't had a chance to test 2.6, but the PSON code hasn't changed.
>>
>> The central question is - are such manifests to be acceptable or not?
>>
>
> Off the cuff, I would say that that (arbitrary data in a content string)
> ought to work. We've had some case (e.g.
> http://projects.puppetlabs.com/issues/3086) with non-seven-bit data in
> semantically significant places (puppet language syntax, some resource
> names, etc.) where not even unicode was permitted. But here it would seem
> that 1) the string should parse correctly and 2) it should serialize /
> deserialize correctly.
I'm currently banging my head against the wall trying to figure out was
causing this in the first place. Obviously, the PSON generator considers
my byte invalid. Tried the attached hotfix (does this work in the
group?), with no success so far. The exception is raised invariably.
I will keep looking for the root problem, thanks for the pointers!
Cheers,
Felix
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" 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-dev?hl=en.
--- /usr/lib/ruby/1.8/puppet/external/pson/pure/generator.rb.orig 2010-09-30 16:55:19.000000000 +0200
+++ /usr/lib/ruby/1.8/puppet/external/pson/pure/generator.rb 2010-09-30 16:55:24.000000000 +0200
@@ -44,6 +44,7 @@
string << '' # XXX workaround: avoid buffer sharing
string.force_encoding(Encoding::ASCII_8BIT)
string.gsub!(/["\\\x0-\x1f]/) { MAP[$MATCH] }
+ string.gsub!(/[\x80-\xc1\xf5-\xff]/) { |c| '/x' + c.unpack("H2")[0] }
string.gsub!(/(
(?:
[\xc2-\xdf][\x80-\xbf] |