summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-02-11 15:45:15 -0800
committerdanielsdeleo <dan@opscode.com>2013-02-11 15:45:15 -0800
commit07bc5331feac1ceaf0627aaf2c52b213f39be45a (patch)
treed358240b7a89999198aef32ffeeebe305da01eaf
parent3f12a8561bd10817db4fc2a4da26d071294a551e (diff)
downloadchef-07bc5331feac1ceaf0627aaf2c52b213f39be45a.tar.gz
switch from JSON.parse to JSONCompat
-rw-r--r--lib/chef/cookbook_version.rb2
-rw-r--r--lib/chef/data_bag.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb
index 580a64ffbe..a70c892e1b 100644
--- a/lib/chef/cookbook_version.rb
+++ b/lib/chef/cookbook_version.rb
@@ -565,7 +565,7 @@ class Chef
cookbook_version.manifest = o
# We don't need the following step when we decide to stop supporting deprecated operators in the metadata (e.g. <<, >>)
- cookbook_version.manifest["metadata"] = JSON.parse(cookbook_version.metadata.to_json)
+ cookbook_version.manifest["metadata"] = Chef::JSONCompat.from_json(cookbook_version.metadata.to_json)
cookbook_version.freeze_version if o["frozen?"]
cookbook_version
diff --git a/lib/chef/data_bag.rb b/lib/chef/data_bag.rb
index 9ce6215b20..be88d07e59 100644
--- a/lib/chef/data_bag.rb
+++ b/lib/chef/data_bag.rb
@@ -101,7 +101,7 @@ class Chef
end
Dir.glob(File.join(Chef::Config[:data_bag_path], "#{name}", "*.json")).inject({}) do |bag, f|
- item = JSON.parse(IO.read(f))
+ item = Chef::JSONCompat.from_json(IO.read(f))
bag[item['id']] = item
bag
end