diff options
author | Brice Figureau <brice@daysofwonder.com> | 2008-08-11 10:49:20 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-08-17 23:45:40 +1000 |
commit | 9272df437c3cee6070f4e765bf61511cd85cb3a7 (patch) | |
tree | cf419843381fc98a8709f144d168abf948d69517 /lib/puppet/rails/resource.rb | |
parent | f48a0ae140661dc14934c0a192c71687929b0624 (diff) | |
download | puppet-9272df437c3cee6070f4e765bf61511cd85cb3a7.tar.gz puppet-9272df437c3cee6070f4e765bf61511cd85cb3a7.tar.xz puppet-9272df437c3cee6070f4e765bf61511cd85cb3a7.zip |
Fix #1052 - abysmal storeconfig performance - part1
Resources whose references are of the form:
Main::Sub1::Sub2
are extracted from the database under the form:
Main::sub1::sub2
Puppet then fails to match them against compiled resources of same
references which are capitalized as they should, and
tries to overwrite them on every storeconfig run, leading to tons
of cascading DELETE/INSERT, hurting performance.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/rails/resource.rb')
-rw-r--r-- | lib/puppet/rails/resource.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb index eabc873df..255b0e788 100644 --- a/lib/puppet/rails/resource.rb +++ b/lib/puppet/rails/resource.rb @@ -82,7 +82,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base end def ref - "%s[%s]" % [self[:restype].capitalize, self[:title]] + "%s[%s]" % [self[:restype].split("::").collect { |s| s.capitalize }.join("::"), self[:title]] end # Convert our object to a resource. Do not retain whether the object |