[chef] Re: Re: Re: Re: Re: Re: File created from template has broken (binary) and incorrect data in it after Chef run


Chronological Thread 
  • From: Ian Marlier < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: File created from template has broken (binary) and incorrect data in it after Chef run
  • Date: Wed, 6 Jun 2012 16:54:11 -0400

Interesting -- can you give an example of what you mean when you suggest making a copy of the params object and assigning the copy?  I don't really understand what that translates into as far as code...

- Ian

On Wed, Jun 6, 2012 at 4:41 PM, Jay Feldblum < " target="_blank"> > wrote:
Ian,

I'd like to suggest a possible explanation: You (or someone) is modifying the params object after declaring the resource. This is a potential explanation because there are no guarantees about what does or does not happen to objects that something else owns, and the things that can happen or not happen are likely to change for reasons that you cannot predict.

Properly speaking, you are of course never allowed to hold onto objects which you don't own, let alone with the assumption that they don't change. This isn't a constraint with Chef in particular. It's a principle of proper software design in general. In this case, you are holding onto the params object by assigning it in the resource's variables attribute. To solve this issue, make a copy of the params object, preferably one holding just the slices of data you actually need for the template resource, and assign the copy in the resource's variables attribute.

Cheers,
Jay

On Wed, Jun 6, 2012 at 11:37 AM, Bryan McLellan < " target="_blank"> > wrote:
On Tue, Jun 5, 2012 at 10:59 PM, AJ Christensen < " target="_blank"> > wrote:
> I've allocated Heavy Water engineering resources in attempt to
> reproduce and track this down. One of our installations saw this
> earlier today.

Can you comment on CHEF-3179 as to what you saw and your environment?

Bryan




--
Ian Marlier | Senior Systems Engineer
Brightcove, Inc.
290 Congress Street, 4th Floor, Boston, MA 02110
" target="_blank">




Archive powered by MHonArc 2.6.16.

§