diff options
author | Markus Roberts <Markus@reality.com> | 2009-12-29 11:14:44 -0800 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2009-12-29 11:14:44 -0800 |
commit | d1ff4b3fca31ee99276c26bc1df6391cfc79254a (patch) | |
tree | 71bccee1ce6fcac587b05486dc4d7dfd85f91fb3 /lib/puppet | |
parent | 4d815117672a6f27ff368c9485edb4edf49e63aa (diff) | |
download | puppet-d1ff4b3fca31ee99276c26bc1df6391cfc79254a.tar.gz puppet-d1ff4b3fca31ee99276c26bc1df6391cfc79254a.tar.xz puppet-d1ff4b3fca31ee99276c26bc1df6391cfc79254a.zip |
Fix for #2994 (undefined method "_file" message)
Attempting to call a constructed method name with a nil component
(the checksum type in this case) causes an unhelpful error message
in a case where either 1) the results were not needed anyway or 2)
a more useful error message would otherwise be generated. It also
opens (at least hypothetically) then possibility that some unrelated
method (in this case "_file" would be called if it existed.
Diffstat (limited to 'lib/puppet')
-rwxr-xr-x | lib/puppet/type/file/content.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb index 36e6c4172..032c7c839 100755 --- a/lib/puppet/type/file/content.rb +++ b/lib/puppet/type/file/content.rb @@ -116,7 +116,7 @@ module Puppet return :absent unless stat = @resource.stat ftype = stat.ftype # Don't even try to manage the content on directories or links - return nil if ["directory","link"].include? ftype + return nil if ["directory","link"].include? ftype or checksum_type.nil? begin "{#{checksum_type}}" + send(checksum_type.to_s + "_file", resource[:path]).to_s |