From 1759bb0b57bf1cd827b1c115b7f853df5c3b0400 Mon Sep 17 00:00:00 2001 From: Antony Deepak Thomas Date: Tue, 21 Sep 2021 22:54:54 -0700 Subject: Swap JSON to JSONCompat Signed-off-by: Antony Deepak Thomas --- lib/chef/resource/file/verification/json.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/chef/resource/file/verification/json.rb b/lib/chef/resource/file/verification/json.rb index c71e6a265e..599c7aed6c 100644 --- a/lib/chef/resource/file/verification/json.rb +++ b/lib/chef/resource/file/verification/json.rb @@ -16,8 +16,6 @@ # limitations under the License. # -require "json" unless defined?(JSON) - class Chef class Resource class File @@ -39,9 +37,9 @@ class Chef provides :json def verify(path, opts = {}) - JSON.parse(IO.read(path)) + Chef::JSONCompat.parse(IO.read(path)) true - rescue JSON::ParserError => e + rescue Chef::Exceptions::JSON::ParseError => e Chef::Log.error("Json syntax verify failed with : #{e.message}") false end -- cgit v1.2.1