Hi All, Has anyone parsed puppet yaml in Java? I am playing with snakeyaml and trying to use a custom class to parse yaml returned by puppet as mentioned in http://code.google.com/p/snakeyaml/wiki/Documentation#Custom_Class_Loader But I am not sure how to deal with "--- !ruby/object:Puppet::Run:" and "!ruby/sym report: !ruby/object:Puppet::Transaction::Report" These seem to be ruby specific. Any answers would help. Thanks. -Mani -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> I am playing with snakeyaml and trying to use a custom class to parse > yaml returned by puppet as mentioned in > http://code.google.com/p/snakeyaml/wiki/Documentation#Custom_Class_Loader > > But I am not sure how to deal with "--- !ruby/object:Puppet::Run:" and > "!ruby/sym report: !ruby/object:Puppet::Transaction::Report" > > These seem to be ruby specific.afair you should be able to just strip that off, before pass it to the yaml reader. There have been some discussion about that on the list and I think this was the solution. ~pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk27WQAACgkQbwltcAfKi3+ImQCglHbndbFbCczd8FsDC2vS9Y8O LXYAoITcmr+RrGDxB+GVm5FTo7o7Ram4 =marw -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, Apr 29, 2011 at 17:34, Peter Meier <peter.meier@immerda.ch> wrote:>> I am playing with snakeyaml and trying to use a custom class to parse >> yaml returned by puppet as mentioned in >> http://code.google.com/p/snakeyaml/wiki/Documentation#Custom_Class_Loader >> >> But I am not sure how to deal with "--- !ruby/object:Puppet::Run:" and >> "!ruby/sym report: !ruby/object:Puppet::Transaction::Report" >> >> These seem to be ruby specific. > > afair you should be able to just strip that off, before pass it to the > yaml reader. There have been some discussion about that on the list and > I think this was the solution.*nod* The two tags are: ''!ruby/sym'' which identifies a "symbol" in Ruby. Translating it as a string should be more than satisfactory for most practical purposes. The other identifies a specific Ruby object; you might want to model that as a Java object, or just treat it as a pool of data – whatever works for you. If you lost both those YAML type tags you really wouldn''t loose much information. Regards, Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ✉ Daniel Pittman <daniel@puppetlabs.com> ✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775 ♲ Made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.