- From: Jesse Campbell <
>
- To: Chef Dev <
>
- Subject: [chef-dev] Re: Re: local file copy resource?
- Date: Sun, 9 Dec 2012 13:44:51 -0500
I have move the functionality of cookbook_file into file, and expanded
it to resolve CHEF-3676 (copy and move for file resource) and
CHEF-1716 (local for cookbook_file resource).
I still need to update the unit tests and run them, but would
appreciate if one of you fine folks could take a look at what I've
done so far, and let me know where I may have gone wrong. (I have
tested local and cookbook files, local and cookbook templates, and
content specified with the content attribute)
Take a look here:
https://github.com/jcam/chef/commits/expanded_file_resource
On Sun, Dec 9, 2012 at 12:27 PM, Jesse Campbell
<
>
wrote:
>
Okay... nevermind, i found it, there is a check for whether
>
cookbook.preferred_filename_on_disk_location returns nil. Yay for good
>
comments :P
>
>
On Sun, Dec 9, 2012 at 10:44 AM, Jesse Campbell
>
<
>
>
wrote:
>
> I'm taking an initial stab at combining cookbook_file and file.
>
>
>
> Before I go too much further, do any of you know how idempotency is
>
> working with cookbook_file?
>
>
>
> I see this in the create:
>
> if file_cache_location && content_stale?
>
>
>
> content_stale looks like this:
>
> def content_stale?
>
> ( ! ::File.exist?(@new_resource.path)) || ( ! compare_content)
>
> end
>
>
>
> compare_content looks like this:
>
> # Compare the content of a file. Returns true if they are the
>
> same, false if they are not.
>
> def compare_content
>
> checksum(@current_resource.path) == new_resource_content_checksum
>
> end
>
>
>
> new_resource_content_checksum looks like this:
>
> def new_resource_content_checksum
>
> @new_resource.content &&
>
> Digest::SHA2.hexdigest(@new_resource.content)
>
> end
>
>
>
> and new_resource.content appears not to be set for cookbook_file.
>
>
>
> What am I missing?
>
>
>
> On Sat, Dec 8, 2012 at 10:03 PM, Bryan McLellan
>
> <
>
>
> wrote:
>
>>
>
>> On Sat, Dec 8, 2012 at 6:46 PM, Noah Kantrowitz
>
>> <
>
>
>> wrote:
>
>>>
>
>>> file "foo" do
>
>>> owner "whatever"
>
>>> content { ::File.new("other") }
>
>>> end
>
>>
>
>>
>
>> That's too complex. "cp foo bar" is easy, we shouldn't have to get into
>
>> ruby
>
>> do accomplish that, nor fall back on the execute resource for something
>
>> this
>
>> common and simple.
>
>>
>
>> Thoughts on idempotency?
>
>>
>
>> Copy could check checksums and copy if they differ or perms differ, sort
>
>> of
>
>> like cookbook_file.
>
>> Move could be only if the source file (path) exists.
>
>>
>
>> Bryan
>
>>
- [chef-dev] local file copy resource?, Jesse Campbell, 12/08/2012
- [chef-dev] Re: local file copy resource?, Noah Kantrowitz, 12/08/2012
- [chef-dev] Re: local file copy resource?, Jesse Campbell, 12/08/2012
- [chef-dev] Re: Re: local file copy resource?, Bryan McLellan, 12/08/2012
- [chef-dev] Re: Re: local file copy resource?, Jesse Campbell, 12/09/2012
- [chef-dev] Re: Re: local file copy resource?, Jesse Campbell, 12/09/2012
- [chef-dev] Re: Re: local file copy resource?, Jesse Campbell, 12/09/2012
- [chef-dev] Re: Re: Re: local file copy resource?, Bryan McLellan, 12/10/2012
- [chef-dev] Re: Re: Re: local file copy resource?, Jesse Campbell, 12/10/2012
- [chef-dev] Re: Re: Re: local file copy resource?, Jesse Campbell, 12/10/2012
- Message not available
- [chef-dev] Re: Re: Re: local file copy resource?, Daniel DeLeo, 12/10/2012
- [chef-dev] Re: Re: Re: Re: local file copy resource?, Jesse Campbell, 12/10/2012
- [chef-dev] Re: Re: Re: Re: local file copy resource?, Daniel DeLeo, 12/11/2012
- [chef-dev] Re: Re: Re: Re: local file copy resource?, Jesse Campbell, 12/11/2012
- [chef-dev] Re: Re: Re: Re: local file copy resource?, Daniel DeLeo, 12/12/2012
- [chef-dev] Re: Re: Re: Re: local file copy resource?, Jesse Campbell, 12/12/2012
- [chef-dev] Re: Re: Re: Re: local file copy resource?, Jesse Campbell, 12/19/2012
Archive powered by MHonArc 2.6.16.