diff options
author | Seth Falcon <seth@opscode.com> | 2013-09-30 16:42:07 -0700 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-10-10 11:29:24 -0700 |
commit | 632999b8f25193e01f3851c0012c038164b51751 (patch) | |
tree | bbfc743f46d96f52912f67e0ec2227a2154f5731 /spec/unit/role_spec.rb | |
parent | 8d9195e73573199317f8ec7534e4da2c93af430b (diff) | |
download | chef-632999b8f25193e01f3851c0012c038164b51751.tar.gz |
Prevent duplicate keys in cookbook version JSON
Reported in CHEF-4571. The recipes component of cookbook version
metadata (cbv.metadata.recipes) serialized to JSON with duplicate keys
if a metadata.rb was present that provided a recipe line matching the
cookbook name (providing a description for the default recipe).
The root cause is the behavior of the JSON serialized when called on a
hash containing matching string and symbol keys. For example:
chef > {"key1" => "sam", :key1 => "wat"}.to_json
=> "{\"key1\":\"sam\",\"key1\":\"wat\"}"
So the specific fix is to prevent inserting a symbol key for the
recipe name.
Diffstat (limited to 'spec/unit/role_spec.rb')
0 files changed, 0 insertions, 0 deletions