+1 On Dec 31, 2009, at 11:56 AM, Markus Roberts wrote:
> 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. > > Signed-off-by: Markus Roberts <[email protected]> > --- > 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 36e6c41..032c7c8 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 > -- > 1.6.4 > > -- > > You received this message because you are subscribed to the Google > Groups "Puppet Developers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected] > . > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en > . > > -- It is a very sad thing that nowadays there is so little useless information. -- Oscar Wilde --------------------------------------------------------------------- Luke Kanies -|- http://reductivelabs.com -|- +1(615)594-8199 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
