summaryrefslogtreecommitdiff
path: root/lib/chef/role.rb
diff options
context:
space:
mode:
authorSeth Falcon <seth@opscode.com>2013-09-30 16:42:07 -0700
committerBryan McLellan <btm@opscode.com>2013-10-10 11:29:24 -0700
commit632999b8f25193e01f3851c0012c038164b51751 (patch)
treebbfc743f46d96f52912f67e0ec2227a2154f5731 /lib/chef/role.rb
parent8d9195e73573199317f8ec7534e4da2c93af430b (diff)
downloadchef-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 'lib/chef/role.rb')
0 files changed, 0 insertions, 0 deletions