diff options
author | Antony Deepak Thomas <antonydeepak@gmail.com> | 2021-09-21 22:54:54 -0700 |
---|---|---|
committer | Antony Deepak Thomas <antonydeepak@gmail.com> | 2021-09-22 10:17:57 -0700 |
commit | 1759bb0b57bf1cd827b1c115b7f853df5c3b0400 (patch) | |
tree | 385ad0ac48ad7fc9a0f172e058500425047a572f | |
parent | c9b7a112f3f01bd0dd6536c7108f0fdf857ae7e1 (diff) | |
download | chef-1759bb0b57bf1cd827b1c115b7f853df5c3b0400.tar.gz |
Swap JSON to JSONCompat
Signed-off-by: Antony Deepak Thomas <antonydeepak@gmail.com>
-rw-r--r-- | lib/chef/resource/file/verification/json.rb | 6 |
1 files 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 |