diff options
author | danielsdeleo <dan@opscode.com> | 2012-11-15 10:50:08 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2012-11-15 10:50:08 -0800 |
commit | 148149b8fff452ff9dff33430d0c862fe52195be (patch) | |
tree | da9fe23d6433e784cf612d4dd983d22290e2ff3b | |
parent | 3af82bf027f1252209469ee8218cfc947a31e5ca (diff) | |
download | chef-148149b8fff452ff9dff33430d0c862fe52195be.tar.gz |
[CHEF-3392] use yajl to avoid custom class inflation
-rw-r--r-- | lib/chef/encrypted_data_bag_item.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/encrypted_data_bag_item.rb b/lib/chef/encrypted_data_bag_item.rb index 565f63318b..f17938cb35 100644 --- a/lib/chef/encrypted_data_bag_item.rb +++ b/lib/chef/encrypted_data_bag_item.rb @@ -20,6 +20,7 @@ require 'base64' require 'openssl' require 'chef/data_bag_item' require 'yaml' +require 'yajl' require 'open-uri' # An EncryptedDataBagItem represents a read-only data bag item where @@ -123,7 +124,7 @@ class Chef::EncryptedDataBagItem # Strings) that do not produce valid JSON when serialized without the # wrapper. def serialized_data - Chef::JSONCompat.to_json(:json_wrapper => plaintext_data) + Yajl::Encoder.encode(:json_wrapper => plaintext_data) end end @@ -170,7 +171,7 @@ class Chef::EncryptedDataBagItem end def for_decrypted_item - Chef::JSONCompat.from_json(decrypted_data)["json_wrapper"] + Yajl::Parser.parse(decrypted_data)["json_wrapper"] end |