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 <[email protected]>
---
 lib/puppet/indirector/catalog/compiler.rb     |    4 ++--
 spec/unit/indirector/catalog/compiler_spec.rb |   10 ++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

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
-- 
1.6.6.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to