diff options
Diffstat (limited to 'lib/chef_zero/endpoints/data_bag_endpoint.rb')
-rw-r--r-- | lib/chef_zero/endpoints/data_bag_endpoint.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef_zero/endpoints/data_bag_endpoint.rb b/lib/chef_zero/endpoints/data_bag_endpoint.rb index 41e87ae..f7a6142 100644 --- a/lib/chef_zero/endpoints/data_bag_endpoint.rb +++ b/lib/chef_zero/endpoints/data_bag_endpoint.rb @@ -1,4 +1,4 @@ -require 'json' +require 'ffi_yajl' require 'chef_zero/endpoints/rest_list_endpoint' require 'chef_zero/endpoints/data_bag_item_endpoint' require 'chef_zero/rest_error_response' @@ -12,7 +12,7 @@ module ChefZero end def post(request) - json = JSON.parse(request.body, :create_additions => false) + json = FFI_Yajl::Parser.parse(request.body, :create_additions => false) key = identity_keys.map { |k| json[k] }.select { |v| v }.first response = super(request) if response[0] == 201 @@ -23,7 +23,7 @@ module ChefZero end def get_key(contents) - data_bag_item = JSON.parse(contents, :create_additions => false) + data_bag_item = FFI_Yajl::Parser.parse(contents, :create_additions => false) if data_bag_item['json_class'] == 'Chef::DataBagItem' && data_bag_item['raw_data'] data_bag_item['raw_data']['id'] else |