summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-08-12 11:48:02 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-08-12 11:48:02 -0700
commitf398a43e00cd08033977ab8437416359cd5a7ea5 (patch)
treed516f79d7289bfb8b259fa6e9a4aac64814b28c6 /lib/chef/cookbook
parentd188093dccf97428dcf625c57a996faada88a31b (diff)
downloadchef-f398a43e00cd08033977ab8437416359cd5a7ea5.tar.gz
remove some uses of from_json
fix some things that don't need create_additions at all and just return standard ruby objects without json_class. convert to JSONCompat#parse which doesn't do any json_class inflation.
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r--lib/chef/cookbook/cookbook_version_loader.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb
index fac8c80993..170446d2e2 100644
--- a/lib/chef/cookbook/cookbook_version_loader.rb
+++ b/lib/chef/cookbook/cookbook_version_loader.rb
@@ -187,7 +187,7 @@ class Chef
def apply_json_cookbook_version_metadata(file)
begin
- data = Chef::JSONCompat.from_json(IO.read(file), :create_additions => false)
+ data = Chef::JSONCompat.parse(IO.read(file))
@metadata.from_hash(data['metadata'])
rescue Chef::Exceptions::JSON::ParseError
Chef::Log.error("Couldn't parse cookbook metadata JSON for #@cookbook_name in " + file)
@@ -198,7 +198,7 @@ class Chef
def set_frozen
if uploaded_cookbook_version_file
begin
- data = Chef::JSONCompat.from_json(IO.read(uploaded_cookbook_version_file), :create_additions => false)
+ data = Chef::JSONCompat.parse(IO.read(uploaded_cookbook_version_file))
@frozen = data['frozen?']
rescue Chef::Exceptions::JSON::ParseError
Chef::Log.error("Couldn't parse cookbook metadata JSON for #@cookbook_name in #{uploaded_cookbook_version_file}")