diff options
Diffstat (limited to 'features/support/couchdb_replicate.rb')
-rw-r--r-- | features/support/couchdb_replicate.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/features/support/couchdb_replicate.rb b/features/support/couchdb_replicate.rb index c44970e0bd..6459c3269e 100644 --- a/features/support/couchdb_replicate.rb +++ b/features/support/couchdb_replicate.rb @@ -27,7 +27,7 @@ require 'rubygems' require 'rest-client' require 'chef/log' -require 'json' +require 'chef/json' # Bulk GET all documents in the given db, using the given page size. # Calls the required block for each page size, passing in an array of @@ -48,7 +48,7 @@ def bulk_get_paged(db, page_size) # Pass :create_additions=>false so JSON parser does *not* expand # custom classes (such as Chef::Node, etc), and instead sticks only # to Array, Hash, String, etc. - paged_results = JSON.parse(paged_results_str, :create_additions => false) + paged_results = Chef::JSON.from_json(paged_results_str, :create_additions => false) paged_rows = paged_results['rows'] if paged_rows.length > 0 @@ -115,7 +115,7 @@ def replicate_dbs(replication_specs, delete_source_dbs = false) doc_in_row end - RestClient.post("#{target_db}/_bulk_docs", ({"docs" => paged_rows}).to_json, :content_type => "application/json") + RestClient.post("#{target_db}/_bulk_docs", Chef::JSON.to_json({"docs" => paged_rows}), :content_type => "application/json") end # Delete the source if asked to.. |