From 9272df437c3cee6070f4e765bf61511cd85cb3a7 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Mon, 11 Aug 2008 10:49:20 +0200 Subject: 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 --- lib/puppet/rails/resource.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 -- cgit