[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Nick Lewis nick at puppetlabs.com
Tue May 10 08:12:59 UTC 2011


The following commit has been merged in the experimental branch:
commit e569f3baec68b9f53b37ac07984b7a858b155991
Author: Nick Lewis <nick at puppetlabs.com>
Date:   Tue Apr 12 13:08:08 2011 -0700

    (#5027) Use Puppet#warning for deprecation_wanring instead of Kernel#warn
    
    Using warning, the deprecation warnings will appear in logs and in color.
    
    Paired-With: Jesse Wolfe

diff --git a/lib/puppet/util/logging.rb b/lib/puppet/util/logging.rb
index 36eb43c..4e76ae4 100644
--- a/lib/puppet/util/logging.rb
+++ b/lib/puppet/util/logging.rb
@@ -18,7 +18,7 @@ module Puppet::Util::Logging
   def deprecation_warning(message)
     $deprecation_warnings ||= Hash.new(0)
     if $deprecation_warnings.length < 100 and ($deprecation_warnings[message] += 1) == 1
-      warn message
+      warning message
     end
   end
 
diff --git a/spec/unit/util/logging_spec.rb b/spec/unit/util/logging_spec.rb
index 63f0a4d..bc2eaff 100755
--- a/spec/unit/util/logging_spec.rb
+++ b/spec/unit/util/logging_spec.rb
@@ -99,21 +99,21 @@ describe Puppet::Util::Logging do
     end
 
     it "should the message with warn" do
-      @logger.expects(:warn).with('foo')
+      @logger.expects(:warning).with('foo')
       @logger.deprecation_warning 'foo'
     end
 
     it "should only log each unique message once" do
-      @logger.expects(:warn).with('foo').once
+      @logger.expects(:warning).with('foo').once
       5.times { @logger.deprecation_warning 'foo' }
     end
 
     it "should only log the first 100 messages" do
       (1..100).each { |i|
-          @logger.expects(:warn).with(i).once
+          @logger.expects(:warning).with(i).once
           @logger.deprecation_warning i
       }
-      @logger.expects(:warn).with(101).never
+      @logger.expects(:warning).with(101).never
       @logger.deprecation_warning 101
     end
   end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list