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

Matt Robinson matt at puppetlabs.com
Tue May 10 08:08:28 UTC 2011


The following commit has been merged in the experimental branch:
commit b42c57ddf618284f69f13c0a5aa48aff9c6d549f
Author: Matt Robinson <matt at puppetlabs.com>
Date:   Thu Mar 24 17:59:56 2011 -0700

    (#6830) Fix stat method calls to not use an unneeded argument
    
    With this change under ruby 1.9.2 the number of failing specs goes from
    2003 to 635.  Also, puppet apply and master both seem to work.  Agent
    still has OpenSSL issues.
    
    Ruby 1.8 doesn't complain if you pass arguments to a runtime defined
    method that doesn't take arguments.  Ruby 1.9 does
    
        class Foo
          define_method('bar') do
            puts 'baz'
          end
        end
    
        Foo.new.bar("idonttakearguments")
    
    In Ruby 1.8 this prints: baz
    
    In Ruby 1.9 this errors with: 19_test.rb:3:in `block in <class:Foo>': wrong
    number of arguments (1 for 0) (ArgumentError)
    
    Reviewed-by:

diff --git a/lib/puppet/provider/file/posix.rb b/lib/puppet/provider/file/posix.rb
index f7b8c97..7b7336b 100644
--- a/lib/puppet/provider/file/posix.rb
+++ b/lib/puppet/provider/file/posix.rb
@@ -54,7 +54,7 @@ Puppet::Type.type(:file).provide :posix do
   end
 
   def retrieve(resource)
-    unless stat = resource.stat(false)
+    unless stat = resource.stat
       return :absent
     end
 
diff --git a/lib/puppet/provider/file/win32.rb b/lib/puppet/provider/file/win32.rb
index 21e7ca9..9423e8f 100644
--- a/lib/puppet/provider/file/win32.rb
+++ b/lib/puppet/provider/file/win32.rb
@@ -49,7 +49,7 @@ Puppet::Type.type(:file).provide :microsoft_windows do
   end
 
   def retrieve(resource)
-    unless stat = resource.stat(false)
+    unless stat = resource.stat
       return :absent
     end
 
diff --git a/lib/puppet/type/file/ctime.rb b/lib/puppet/type/file/ctime.rb
index 24b0987..90d95da 100644
--- a/lib/puppet/type/file/ctime.rb
+++ b/lib/puppet/type/file/ctime.rb
@@ -4,7 +4,7 @@ module Puppet
 
     def retrieve
       current_value = :absent
-      if stat = @resource.stat(false)
+      if stat = @resource.stat
         current_value = stat.ctime
       end
       current_value
diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb
index 99652ec..0f065da 100755
--- a/lib/puppet/type/file/ensure.rb
+++ b/lib/puppet/type/file/ensure.rb
@@ -138,7 +138,7 @@ module Puppet
     end
 
     def retrieve
-      if stat = @resource.stat(false)
+      if stat = @resource.stat
         return stat.ftype.intern
       else
         if self.should == :false
diff --git a/lib/puppet/type/file/group.rb b/lib/puppet/type/file/group.rb
index 5ed5166..4d1f2f4 100755
--- a/lib/puppet/type/file/group.rb
+++ b/lib/puppet/type/file/group.rb
@@ -62,7 +62,7 @@ module Puppet
     end
 
     def retrieve
-      return :absent unless stat = resource.stat(false)
+      return :absent unless stat = resource.stat
 
       currentvalue = stat.gid
 
diff --git a/lib/puppet/type/file/mode.rb b/lib/puppet/type/file/mode.rb
index 2acd8b3..9f58e6f 100755
--- a/lib/puppet/type/file/mode.rb
+++ b/lib/puppet/type/file/mode.rb
@@ -63,7 +63,7 @@ module Puppet
       # If we're not following links and we're a link, then we just turn
       # off mode management entirely.
 
-      if stat = @resource.stat(false)
+      if stat = @resource.stat
         unless defined?(@fixed)
           @should &&= @should.collect { |s| self.dirmask(s) }
         end
diff --git a/lib/puppet/type/file/mtime.rb b/lib/puppet/type/file/mtime.rb
index 8ca7ed0..5952b4b 100644
--- a/lib/puppet/type/file/mtime.rb
+++ b/lib/puppet/type/file/mtime.rb
@@ -4,7 +4,7 @@ module Puppet
 
     def retrieve
       current_value = :absent
-      if stat = @resource.stat(false)
+      if stat = @resource.stat
         current_value = stat.mtime
       end
       current_value
diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb
index ea385ee..1b1a772 100644
--- a/lib/puppet/type/file/selcontext.rb
+++ b/lib/puppet/type/file/selcontext.rb
@@ -26,7 +26,7 @@ module Puppet
     include Puppet::Util::SELinux
 
     def retrieve
-      return :absent unless @resource.stat(false)
+      return :absent unless @resource.stat
       context = self.get_selinux_current_context(@resource[:path])
       parse_selinux_context(name, context)
     end
diff --git a/lib/puppet/type/file/type.rb b/lib/puppet/type/file/type.rb
index 4da54e2..864d3b1 100755
--- a/lib/puppet/type/file/type.rb
+++ b/lib/puppet/type/file/type.rb
@@ -5,7 +5,7 @@ module Puppet
 
     def retrieve
       current_value = :absent
-      if stat = @resource.stat(false)
+      if stat = @resource.stat
         current_value = stat.ftype
       end
       current_value

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list