diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2011-03-24 17:59:56 -0700 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2011-03-25 10:30:27 -0700 |
| commit | b42c57ddf618284f69f13c0a5aa48aff9c6d549f (patch) | |
| tree | a64c03f0e8637736131b31af1fa782f195a7d6f1 /lib/puppet | |
| parent | c7f6e5ee743c061c020521651360bba240ae4519 (diff) | |
| download | puppet-b42c57ddf618284f69f13c0a5aa48aff9c6d549f.tar.gz puppet-b42c57ddf618284f69f13c0a5aa48aff9c6d549f.tar.xz puppet-b42c57ddf618284f69f13c0a5aa48aff9c6d549f.zip | |
(#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:
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/provider/file/posix.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/provider/file/win32.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/type/file/ctime.rb | 2 | ||||
| -rwxr-xr-x | lib/puppet/type/file/ensure.rb | 2 | ||||
| -rwxr-xr-x | lib/puppet/type/file/group.rb | 2 | ||||
| -rwxr-xr-x | lib/puppet/type/file/mode.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/type/file/mtime.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/type/file/selcontext.rb | 2 | ||||
| -rwxr-xr-x | 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 f7b8c9797..7b7336b9d 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 21e7ca974..9423e8f00 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 24b098703..90d95da64 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 99652ecc6..0f065da14 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 5ed5166bc..4d1f2f4e6 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 2acd8b359..9f58e6fb0 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 8ca7ed0d6..5952b4b84 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 ea385eec0..1b1a77245 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 4da54e2cb..864d3b1a4 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 |
