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/08/08 14:54:37 UTC

[PATCH core 4/6] Client: Return 'nil' from destroy operations on buckets/blobs

From: Michal Fojtik <mf...@redhat.com>

* All :destroy operation should return 'nil' when they succeed

Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 client/lib/client_bucket_methods.rb |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/lib/client_bucket_methods.rb b/client/lib/client_bucket_methods.rb
index 44eca0f..a3dfda0 100644
--- a/client/lib/client_bucket_methods.rb
+++ b/client/lib/client_bucket_methods.rb
@@ -27,7 +27,7 @@ module ClientBucketMethods
     #actually response here is 204 - no content - so nothing returned to client?
     request(:delete, "#{api_uri.to_s}/buckets/#{params['id']}") do |response|
       handle_backend_error(response) if response.code!=204
-      response
+      nil if response.code == 204
     end
   end
 
@@ -53,7 +53,7 @@ module ClientBucketMethods
   def destroy_blob(params)
     request(:delete, "#{api_uri.to_s}/buckets/#{params['bucket']}/#{params[:id]}") do |response|
       handle_backend_error(response) if response.code!=204
-      response
+      nil if response.code == 204
     end
   end
 
-- 
1.7.10.2