diff options
author | Luke Kanies <luke@madstop.com> | 2009-04-21 17:12:42 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-04-21 17:12:42 -0500 |
commit | 8d0e9976b199a637d82d70701db6c682a89b9d6a (patch) | |
tree | 6378ac505c4b93015dbca1d02269e6de8e92cc8b /lib/puppet | |
parent | 4e0de3881b55a728ee54e1cab5d3b9a6ab52a5a9 (diff) | |
download | puppet-8d0e9976b199a637d82d70701db6c682a89b9d6a.tar.gz puppet-8d0e9976b199a637d82d70701db6c682a89b9d6a.tar.xz puppet-8d0e9976b199a637d82d70701db6c682a89b9d6a.zip |
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 <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/resource/catalog.rb | 14 |
1 files changed, 14 insertions, 0 deletions
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 |