You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/07/19 15:02:43 UTC
[PATCH core 10/16] Core: Replaced obsoleted convert_to_xml with xml_to_json helper in buckets
From: Michal Fojtik <mf...@redhat.com>
Signed-off-by: Michal fojtik <mf...@redhat.com>
---
server/lib/deltacloud/collections/buckets.rb | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/server/lib/deltacloud/collections/buckets.rb b/server/lib/deltacloud/collections/buckets.rb
index 77a431c..b7b3729 100644
--- a/server/lib/deltacloud/collections/buckets.rb
+++ b/server/lib/deltacloud/collections/buckets.rb
@@ -58,7 +58,7 @@ module Deltacloud::Collections
respond_to do |format|
format.xml { haml :"blobs/show" }
format.html { haml :"blobs/show" }
- format.json { convert_to_json(:blob, @blob) }
+ format.json { xml_to_json 'blobs/show' }
end
elsif(env["BLOB_FAIL"])
report_error(500) #OK?
@@ -77,7 +77,7 @@ module Deltacloud::Collections
respond_to do |format|
format.xml { haml :"blobs/show" }
format.html { haml :"blobs/show" }
- format.json { convert_to_json(:blob, @blob) }
+ format.json { xml_to_json 'blobs/show' }
end
end
end
@@ -96,7 +96,7 @@ module Deltacloud::Collections
response['Location'] = bucket_url(@bucket.id)
respond_to do |format|
format.xml { haml :"buckets/show" }
- format.json { convert_to_json(:bucket, @bucket) }
+ format.json { xml_to_json('buckets/show') }
format.html do
redirect bucket_url(@bucket.id) if @bucket and @bucket.id
redirect buckets_url
@@ -126,7 +126,7 @@ module Deltacloud::Collections
respond_to do |format|
format.xml { haml :"blobs/show" }
format.html { haml :"blobs/show" }
- format.json { convert_to_json(:blob, @blob) }
+ format.json { xml_to_json 'blobs/show' }
end
else
report_error(404)
@@ -155,10 +155,11 @@ module Deltacloud::Collections
end
end
@blob = driver.create_blob(credentials, bucket_id, blob_id, blob_data, user_meta)
+ status 201
respond_to do |format|
format.xml { haml :"blobs/show" }
format.html { haml :"blobs/show"}
- format.json {convert_to_json(:blob, @blob)}
+ format.json { xml_to_json 'blobs/show' }
end
end
end
@@ -188,7 +189,7 @@ module Deltacloud::Collections
respond_to do |format|
format.xml { haml :"blobs/show" }
format.html { haml :"blobs/show" }
- format.json { convert_to_json(:blob, @blob) }
+ format.json { xml_to_json 'blobs/show' }
end
elsif(env["BLOB_FAIL"])
report_error(500) #OK?
@@ -207,7 +208,7 @@ module Deltacloud::Collections
respond_to do |format|
format.xml { haml :"blobs/show" }
format.html { haml :"blobs/show" }
- format.json { convert_to_json(:blob, @blob) }
+ format.json { xml_to_json 'blobs/show' }
end
end
end
--
1.7.10.2