summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs/file_system/rest_list_entry.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/chef_fs/file_system/rest_list_entry.rb')
-rw-r--r--lib/chef/chef_fs/file_system/rest_list_entry.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/chef_fs/file_system/rest_list_entry.rb b/lib/chef/chef_fs/file_system/rest_list_entry.rb
index 0d5557de1d..67252a6f2f 100644
--- a/lib/chef/chef_fs/file_system/rest_list_entry.rb
+++ b/lib/chef/chef_fs/file_system/rest_list_entry.rb
@@ -128,8 +128,8 @@ class Chef
value = minimize_value(value)
value_json = Chef::JSONCompat.to_json_pretty(value)
begin
- other_value = JSON.parse(other_value_json, :create_additions => false)
- rescue JSON::ParserError => e
+ other_value = Chef::JSONCompat.parse(other_value_json)
+ rescue Chef::Exceptions::JSON::ParseError => e
Chef::Log.warn("Parse error reading #{other.path_for_printing} as JSON: #{e}")
return [ nil, value_json, other_value_json ]
end
@@ -145,8 +145,8 @@ class Chef
def write(file_contents)
begin
- object = JSON.parse(file_contents, :create_additions => false)
- rescue JSON::ParserError => e
+ object = Chef::JSONCompat.parse(file_contents)
+ rescue Chef::Exceptions::JSON::ParseError => e
raise Chef::ChefFS::FileSystem::OperationFailedError.new(:write, self, e), "Parse error reading JSON: #{e}"
end