From 8d0e9976b199a637d82d70701db6c682a89b9d6a Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 21 Apr 2009 17:12:42 -0500 Subject: Fixing #2180 - Catalogs yaml dump the resource table first This fixes a ruby bug (http://rubyforge.org/tracker/?group_id=426&atid=1698&func=detail&aid=8886) that otherwise results in yaml producing text it can't read back in. Signed-off-by: Luke Kanies --- lib/puppet/resource/catalog.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/puppet') diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb index 88aa9517d..cb0ce0333 100644 --- a/lib/puppet/resource/catalog.rb +++ b/lib/puppet/resource/catalog.rb @@ -416,6 +416,20 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph super end + def to_yaml_properties + result = instance_variables + + # There's a ruby bug that hits us without this: + # http://rubyforge.org/tracker/?group_id=426&atid=1698&func=detail&aid=8886 + # We need our resources to show up in as values in a hash + # before they show up as keys, because otherwise + # the loading fails. + result.delete "@resource_table" + result.unshift "@resource_table" + + result + end + private def cleanup -- cgit