On Tue, Mar 1, 2011 at 3:07 PM, donavan <[email protected]> wrote:
> On Mar 1, 2:41 pm, Matt Robinson <[email protected]> wrote:
>> Ugh, another case of trying to fix auditing breaking other stuff.  I'm
>> looking into this.  I've got a quick and dirty patch that fixes this,
>> but I want to see if there's a better way.
>>
>> diff --git a/lib/puppet/type/file/content.rb 
>> b/lib/puppet/type/file/content.rb
>> index 5223ee3..430d5a2 100755
>> --- a/lib/puppet/type/file/content.rb
>> +++ b/lib/puppet/type/file/content.rb
>> @@ -166,7 +166,7 @@ module Puppet
>>      def each_chunk_from(source_or_content)
>>        if source_or_content.is_a?(String)
>>          yield source_or_content
>> -      elsif source_or_content.nil? && resource.parameter(:ensure) &&
>> [:present, :file].include?(resource.parameter(:ensure).value)
>
> Forgot to mention, don't forget all the other supported digest types
> in Puppet::Util::Checksums. Would hate to punish people who went out
> of their way to do the right thing and use sha1. May be easier (and
> expensive?) to call Puppet::Util::Checksums.checksum?
> (resource.parameter(:content)).

Thanks for the suggestion.  I ended up rearranging the if statement a
bit so that we didn't need as much && logic.  I mailed the patch to
the list just now, and will merge it shortly into 2.6.next. I'll also
attach my branch to the ticket (#6541) in case that's easier for
anyone who wants to test.

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

Reply via email to