summaryrefslogtreecommitdiffstats
path: root/lib/puppet/resource.rb
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-08-13 13:32:33 -0700
committerJames Turnbull <james@lovedthanlost.net>2010-08-31 08:17:21 +1000
commite783a16fbc2c856c212094b4a787a08c16536a0d (patch)
tree8acd5c1a4200d67396b634693e5515c4e5f85944 /lib/puppet/resource.rb
parentf59cfc8533e21d45a42a429cf11fcc2cea2cc482 (diff)
downloadpuppet-e783a16fbc2c856c212094b4a787a08c16536a0d.tar.gz
puppet-e783a16fbc2c856c212094b4a787a08c16536a0d.tar.xz
puppet-e783a16fbc2c856c212094b4a787a08c16536a0d.zip
Fix for #4506 -- too much data being serialized
The serialization of much of the memory image was being triggered by a copy of an unchanging method return value in an instance variable. I had introduced this as a performance hack. The results were correct, but when the object was serialized it took a huge amount of data with it (known_resource_types, and from there...) As the underlying costly operation is no longer being called (thanks to Paul and Jesse) the caching is no longer a significant performance boost, and can thus simply be removed.
Diffstat (limited to 'lib/puppet/resource.rb')
-rw-r--r--lib/puppet/resource.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index c4e52af18..39803b077 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -193,7 +193,7 @@ class Puppet::Resource
end
def resource_type
- @resource_type ||= case type
+ case type
when "Class"; known_resource_types.hostclass(title == :main ? "" : title)
when "Node"; known_resource_types.node(title)
else