You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by rl...@redhat.com on 2013/03/01 20:14:06 UTC
DTACLOUD-498 - patch - minor corrections
Originally, NACK'ed http://tracker.deltacloud.org/set/362 because the changes caused an error (see DTACOUD-498 for details).
However, it looks like the patch was just missing two ')'. [PATCH 2/2] adds these to the patch.
Testing with both patches, the mock driver shows that the bucket number does update when blobs are added.
Marios, I'm attaching this second patch to the JIRA for your review.
[PATCH 1/2] DTACLOUD-498 - nit in mock driver create/delete blobs - update bucket size
Posted by rl...@redhat.com.
From: marios <ma...@redhat.com>
https://issues.apache.org/jira/browse/DTACLOUD-498
Signed-off-by: marios <ma...@redhat.com>
TrackedAt: http://tracker-mfojtik.rhcloud.com/patch/03b3210c6e63a36f3881904468dc00e34d858aad
---
server/lib/deltacloud/drivers/mock/mock_driver.rb | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
index 23eeaf6..7d7b17b 100644
--- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
@@ -499,6 +499,7 @@ module Deltacloud::Drivers::Mock
:content => blob_data
})
end
+ update_bucket_size(bucket_id, :plus
Blob.new(@client.store(:blobs, blob))
end
@@ -509,6 +510,7 @@ module Deltacloud::Drivers::Mock
check_credentials(credentials)
safely do
raise "NotExistentBlob" unless @client.load_collection(:blobs, blob_id)
+ update_bucket_size(bucket_id, :minus
@client.destroy(:blobs, blob_id)
end
end
@@ -608,6 +610,18 @@ module Deltacloud::Drivers::Mock
StorageVolume.new(volume)
end
+ def update_bucket_size(id, change)
+ bucket = @client.load_collection(:buckets, id)
+ raise 'BucketNotExist' if bucket.nil?
+ bucket[:size] = case change
+ when :plus then bucket[:size].to_i + 1
+ when :minus then bucket[:size].to_i - 1
+ else
+ raise "unkown update operation for bucket!"
+ end
+ @client.store(:buckets, bucket)
+ end
+
exceptions do
on /AuthFailure/ do
--
1.7.7.6
[PATCH 2/2] DTACLOUD-498 - patch - minor corrections
Posted by rl...@redhat.com.
From: Ronelle Landy <rl...@redhat.com>
---
server/lib/deltacloud/drivers/mock/mock_driver.rb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
index 7d7b17b..07c67e2 100644
--- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
@@ -499,7 +499,7 @@ module Deltacloud::Drivers::Mock
:content => blob_data
})
end
- update_bucket_size(bucket_id, :plus
+ update_bucket_size(bucket_id, :plus)
Blob.new(@client.store(:blobs, blob))
end
@@ -510,7 +510,7 @@ module Deltacloud::Drivers::Mock
check_credentials(credentials)
safely do
raise "NotExistentBlob" unless @client.load_collection(:blobs, blob_id)
- update_bucket_size(bucket_id, :minus
+ update_bucket_size(bucket_id, :minus)
@client.destroy(:blobs, blob_id)
end
end
--
1.7.7.6