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:

Signed-off-by: Matt Robinson <m...@puppetlabs.com>
---
Local-branch: ticket/next/6830_stat_calls
 lib/puppet/provider/file/posix.rb  |    2 +-
 lib/puppet/provider/file/win32.rb  |    2 +-
 lib/puppet/type/file/ctime.rb      |    2 +-
 lib/puppet/type/file/ensure.rb     |    2 +-
 lib/puppet/type/file/group.rb      |    2 +-
 lib/puppet/type/file/mode.rb       |    2 +-
 lib/puppet/type/file/mtime.rb      |    2 +-
 lib/puppet/type/file/selcontext.rb |    2 +-
 lib/puppet/type/file/type.rb       |    2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

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

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

Reply via email to