[chef] Re: FYI - .to_hash bug


Chronological Thread 
  • From: Mike < >
  • To: " " < >
  • Subject: [chef] Re: FYI - .to_hash bug
  • Date: Fri, 4 Oct 2013 14:35:26 -0400

Hey Phil,

Looks like you might be seeing something similar to https://tickets.opscode.com/browse/CHEF-1804

-M


On Fri, Oct 4, 2013 at 2:33 PM, Phil Dibowitz < " target="_blank"> > wrote:
Hey guys,

I just wanted to let people know I recently filed CHEF-4596.

It's a common thing in chef to call `.to_hash` on an attribute so you can loop
on it (iterating on attributes will usually give you not the thing you want
because of the way Chef autovivifies)...

Turns out in Chef 10... at least some versions... .to_hash will sometimes
de-dupe internal arrays of a hash. So if you have {:foo=>['a', 'b', 'a']} in
your hash somewhere, what you'll get is {:foo=>['a', 'b']} and this could
seriously mess some people up in very subtle ways.


--
Phil Dibowitz                             ">
Open Source software and tech docs        Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"Be who you are and say what you feel, because those who mind don't matter
 and those who matter don't mind."
 - Dr. Seuss






Archive powered by MHonArc 2.6.16.

§