You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/07/20 11:59:21 UTC
[9/65] git commit: Core: Replaced obsoleted convert_to_xml with
xml_to_json helper in buckets
Core: Replaced obsoleted convert_to_xml with xml_to_json helper in buckets
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/8da2883d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/8da2883d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/8da2883d
Branch: refs/heads/master
Commit: 8da2883d55fb7558a01030c2c6368f51221b82d0
Parents: 1392984
Author: Michal Fojtik <mf...@redhat.com>
Authored: Thu Jul 19 14:53:56 2012 +0200
Committer: Michal fojtik <mf...@redhat.com>
Committed: Fri Jul 20 11:59:09 2012 +0200
----------------------------------------------------------------------
server/lib/deltacloud/collections/buckets.rb | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8da2883d/server/lib/deltacloud/collections/buckets.rb
----------------------------------------------------------------------
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