[chef-dev] Re: local file copy resource?


Chronological Thread 
  • From: Bryan McLellan < >
  • To: Jesse Campbell < >
  • Cc: Chef Dev < >
  • Subject: [chef-dev] Re: local file copy resource?
  • Date: Sat, 8 Dec 2012 21:59:47 -0500

On Sat, Dec 8, 2012 at 6:41 PM, Jesse Campbell < " target="_blank"> > wrote:
- The File resource is very simple, and that is a good thing, don't
want to over load it doing too many things

You're managing files, so you should be able to use the File resource. 

There was discussion a few years ago about moving remote_file into file [1] for that reason, although it never happened. 

IMHO, we correctly did not repeat this pattern of creating multiple resources based on location elsewhere after the initial implementations. For example, we don't need separate mount resources for local and remote filesystems.

Adding a :to attribute to the File resource, like we have in the Link resource and adding move/copy actions to it makes sense to me. I don't think it would clutter the file resource because we're adding separate actions, which is where the bulk of the change would be.

Cookbook File is not what you're managing, so we shouldn't be in that resource. If there's code to reuse we could refactor such, but I don't expect that to be ideal.

A resource should be a 'what,' that is, what we are abstracting. The details should be in the action and attributes and where appropriate we should be intuitive about it, such as seeing that a source attribute is a URL, but we also need to be careful to not overload an attribute such that we have to parse it for different pieces of data.

Neckbeard in spirit,
Bryan




Archive powered by MHonArc 2.6.16.

§