[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-663-g71824ee

Markus Roberts Markus at reality.com
Tue Jul 20 07:42:25 UTC 2010


The following commit has been merged in the upstream branch:
commit 6e07a199011b434ea6d7b3c69d14e6ca7cf9cf8e
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Sat Jul 17 17:25:04 2010 +0200

    Fix #4262 - Puppetmaster used to log compilation time
    
    It looks like a merge went wrong and we were returning abruptely
    from a benchmark block, thus jumping over a precious log information.
    
    Signed-off-by: Brice Figureau <brice-puppet at daysofwonder.com>

diff --git a/lib/puppet/indirector/catalog/compiler.rb b/lib/puppet/indirector/catalog/compiler.rb
index e85608e..c50022f 100644
--- a/lib/puppet/indirector/catalog/compiler.rb
+++ b/lib/puppet/indirector/catalog/compiler.rb
@@ -72,9 +72,9 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
 
     loglevel = networked? ? :notice : :none
 
-    benchmark(loglevel, "Compiled catalog for #{node.name}") do
+    benchmark(loglevel, str) do
       begin
-        return Puppet::Parser::Compiler.compile(node)
+        config = Puppet::Parser::Compiler.compile(node)
       rescue Puppet::Error => detail
         Puppet.err(detail.to_s) if networked?
         raise
diff --git a/spec/unit/indirector/catalog/compiler_spec.rb b/spec/unit/indirector/catalog/compiler_spec.rb
index 755509f..2ae5f6f 100755
--- a/spec/unit/indirector/catalog/compiler_spec.rb
+++ b/spec/unit/indirector/catalog/compiler_spec.rb
@@ -137,6 +137,16 @@ describe Puppet::Resource::Catalog::Compiler do
       Puppet::Parser::Compiler.stubs(:compile)
       @compiler.find(@request)
     end
+
+    it "should log the benchmark result" do
+      Puppet::Node.stubs(:find).returns(@node)
+      @compiler.stubs(:networked?).returns(true)
+      Puppet::Parser::Compiler.stubs(:compile)
+
+      Puppet.expects(:notice).with { |msg| msg =~ /Compiled catalog/ }
+
+      @compiler.find(@request)
+    end
   end
 
   describe "when extracting facts from the request" do

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list