evertrue / zookeeper-cookbook

Chef cookbook for installing and managing Zookeeper.
https://supermarket.chef.io/cookbooks/zookeeper
Apache License 2.0
81 stars 117 forks source link

Duplicate immutable property to support chef 13 #207

Closed bai closed 6 years ago

bai commented 6 years ago

In Chef Client 13 some types of resource properties became immutable, including Hash. So, in order to change the "environment" hash, we need to create a mutable copy first.

cc: @evertrue @jeffbyrnes

jeffbyrnes commented 6 years ago

As we’re assigning it to a new variable, this shouldn’t cause any issues? Are you seeing a warning or error in your Chef runs?

bai commented 6 years ago

Yep, when you assign it to a new variable it makes a pointer instead of duping the value, this PR makes an actual dup.

jeffbyrnes commented 6 years ago

@bai aha! The subtleties of Ruby. Sometimes pointers, sometimes copies. Sounds good.