On Mon, 2009-04-27 at 00:24 +0100, Luke Kanies wrote: > On Apr 26, 2009, at 8:02 PM, Brice Figureau wrote: > > > > > On 26/04/09 2:29, Luke Kanies wrote: > >> On Apr 25, 2009, at 5:49 PM, Brice Figureau wrote: > >> > >>> On 25/04/09 1:10, Luke Kanies wrote: > >>>> Unfortunately, again because of a Ruby bug > >>>> (http://rubyforge.org/tracker/?group_id=426&atid=1698&func=detail&aid=8886 > >>>> ) > >>>> Ruby can't print yaml that it can read, if custom > >>>> classes are used as keys in hashes, which Sets use internally. > >>> Note, that I can trigger the same issue but with the VertexWrapper > >>> in > >>> and out Sets in relation to RelationShip: > >>> > >>> ... > >>> vertices: > >>> *id002: !ruby/object:Puppet::SimpleGraph::VertexWrapper > >>> adjacencies: > >>> :out: {} > >>> > >>> :in: > >>> *id003: !ruby/object:Set > >>> hash: > >>> &id004 !ruby/object:Puppet::Relationship ? > >>> ------------------^ > >>> not good! > > > > Basically, this is invalid yaml, it should have been written: > > ? &id004 !ruby/object:Puppet::Relationship > > Yep, that's the bug. > > > > >>> source: *id003 > >>> target: *id002 > >>> : true > >>> > >>> vertex: *id002 > >>> ... > >> > >> Even with this patch applied? > > > > Yes, otherwise I wouldn't have posted this mail :-) > > Please see my mail: > > [Puppet-dev] [PATCH 1/1] Fix-up incorrectly generated yaml > > for a relatively safe fix-up/workaround for this bug. > > I wasn't quite sure; the phrasing of the email wasn't entirely clear > to me, and your patch hadn't been sent quite yet, I think.
Yes, I usually fail to write attractive subject and commit msg :-) When I git sent the patch, it should have been a reply to this thread, but somehow it didn't work, I sent a reply to the patch to be more accurate on what it was doing. > The patch is probably a better idea at this point than my constant > patches to each of the classes to reorder the attributes printed. Yes, I do think so. Especially that like with the Sets, you can't always reorder the yaml. > > > > I don't expect ruby to automagically fix this issue as they didn't > > move > > in 2 years the bug was reported, so basically the ball is in our > > camp to > > fix this. > > Yep. > > > > >>> And it seems --catalog_format doesn't exist anynore in 0.25, is that > >>> right? > >> > >> > >> Right; we have a general serialization system now as part of the > >> Indirector (Puppet::Network::Format*), and the format is essentially > >> chosen automatically but you can set a preferred serialization format > >> for all types that serialize (e.g., not files). The new option is, > >> creatively, --preferred_serialization_format=<foo>. > > > > OK. If you don't want to fix-up the produced yaml, then I suggest a > > switch to Marshal for the catalog indirection if it is possible. > > > Either way I think it should be fixed; people want to use yaml because > it's so readable. > > Your patch is a good idea, I just haven't been able to review it > because I'm too busy having beer foisted upon me in London. :) lol :-) Enjoy your ales! -- Brice Figureau My Blog: http://www.masterzen.fr/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
