From d1ff4b3fca31ee99276c26bc1df6391cfc79254a Mon Sep 17 00:00:00 2001 From: Markus Roberts Date: Tue, 29 Dec 2009 11:14:44 -0800 Subject: 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. --- lib/puppet/type/file/content.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet') 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 -- cgit