summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-09-24 09:18:47 -0700
committertyler-ball <tyleraball@gmail.com>2014-10-07 16:39:56 -0700
commit1c7b4629240c49e02c482da6de1a6a2cc574304e (patch)
tree4ac2fdc415837aca9b15e6c93debda44858cbf9b /lib/chef/chef_fs
parent1343bdfff0d54e20b923211f6697d42c484c1627 (diff)
downloadchef-1c7b4629240c49e02c482da6de1a6a2cc574304e.tar.gz
Trying to eradicate all traces of the JSON gem from Chef
Diffstat (limited to 'lib/chef/chef_fs')
-rw-r--r--lib/chef/chef_fs/file_system/organization_invites_entry.rb3
-rw-r--r--lib/chef/chef_fs/file_system/organization_members_entry.rb3
-rw-r--r--lib/chef/chef_fs/file_system/rest_list_entry.rb3
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/chef/chef_fs/file_system/organization_invites_entry.rb b/lib/chef/chef_fs/file_system/organization_invites_entry.rb
index cb26326050..5df37085cb 100644
--- a/lib/chef/chef_fs/file_system/organization_invites_entry.rb
+++ b/lib/chef/chef_fs/file_system/organization_invites_entry.rb
@@ -1,5 +1,6 @@
require 'chef/chef_fs/file_system/rest_list_entry'
require 'chef/chef_fs/data_handler/organization_invites_data_handler'
+require 'chef/json_compat'
class Chef
module ChefFS
@@ -34,7 +35,7 @@ class Chef
end
def write(contents)
- desired_invites = minimize_value(JSON.parse(contents, :create_additions => false))
+ desired_invites = minimize_value(Chef::JSONCompat.parse(contents, :create_additions => false))
actual_invites = _read_json.inject({}) { |h,val| h[val['username']] = val['id']; h }
invites = actual_invites.keys
(desired_invites - invites).each do |invite|
diff --git a/lib/chef/chef_fs/file_system/organization_members_entry.rb b/lib/chef/chef_fs/file_system/organization_members_entry.rb
index eb524d5ea2..94393b341f 100644
--- a/lib/chef/chef_fs/file_system/organization_members_entry.rb
+++ b/lib/chef/chef_fs/file_system/organization_members_entry.rb
@@ -1,5 +1,6 @@
require 'chef/chef_fs/file_system/rest_list_entry'
require 'chef/chef_fs/data_handler/organization_members_data_handler'
+require 'chef/json_compat'
class Chef
module ChefFS
@@ -34,7 +35,7 @@ class Chef
end
def write(contents)
- desired_members = minimize_value(JSON.parse(contents, :create_additions => false))
+ desired_members = minimize_value(Chef::JSONCompat.parse(contents, :create_additions => false))
members = minimize_value(_read_json)
(desired_members - members).each do |member|
begin
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 ac47ff4f25..f68794cb0d 100644
--- a/lib/chef/chef_fs/file_system/rest_list_entry.rb
+++ b/lib/chef/chef_fs/file_system/rest_list_entry.rb
@@ -21,6 +21,7 @@ require 'chef/chef_fs/file_system/not_found_error'
require 'chef/chef_fs/file_system/operation_failed_error'
require 'chef/role'
require 'chef/node'
+require 'chef/json_compat'
class Chef
module ChefFS
@@ -172,7 +173,7 @@ class Chef
def api_error_text(response)
begin
- JSON.parse(response.body)['error'].join("\n")
+ Chef::JSONCompat.parse(response.body)['error'].join("\n")
rescue
response.body
end