>> I am very new to yaml so I have to research your suggestions. It > >> sounds like I'll need to create an object for the yaml output to map > >> to though. > >> > >> I'll respond back in the thread once I figure this out. > > > > It looks likr pyyaml does support loading foreign types (by mapping > them). > > Look for add_constructor on this page: > > http://pyyaml.org/wiki/PyYAMLDocumentation for some examples of how to > do > > this. You can probably get away with just making all ruby objects into > > dictionaries for a start. > > I've always done this in Python by specifying yaml tags, > > > http://groups.google.com/group/puppet-users/browse_thread/thread/ededa6a1da32cb00 > > class PuppetReport(yaml.YAMLObject): > yaml_tag = u'!ruby/object:Puppet::Transaction::Report' > def __init__(self, host, logs, metrics, records, time): > self.host = host > self.logs = logs > self.metrics = metrics > self.records = records > self.time = time > > but there are a few options here depending on what you're doing. >
I like that way! Nicely coupled to the intent. -- M ----------------------------------------------------------- When in trouble or in doubt, run in circles, scream and shout. -- 1920's parody of the maritime general prudential rule ------------------------------------------------------------ -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.