incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marios@redhat.com" <mandr...@redhat.com>
Subject Re: [PATCH] Adds ability to specify arbitrary user metadata (KEY-VALUE) for S3, Cloudfiles and Azure, during blob creation.
Date Mon, 24 Jan 2011 15:47:08 GMT
On 22/01/11 02:14, David Lutterkort wrote:
> Some comments below:
>> +    def replace_hash_keys(hash, pattern)
>
> Nit pick: what you call 'pattern' is really the replacement.
>
> The Ruby way to do something like this is to define it directly in the
> Hash class, i.e. doing something like
>
>          class Hash
>             def replace_keys(pattern)
>               ...
>             end
>          end
>
> though it might be clearer to have a method Hash.gsub_keys(pattern,
> replacement)
>
cool :) thanks for your comments, I'll rework the patch and send out 
again (including the x-deltacloud-meta headers tweak for passing in the 
metadata values - i'm thinking we can have both mechanisms [params and 
headers] i.e. just add the checking for x-deltacloud-meta headers to the 
code.. i'll see how this works in practice),

marios



>>     end
>>
>>   end
>> diff --git a/server/lib/deltacloud/drivers/azure/azure_driver.rb b/server/lib/deltacloud/drivers/azure/azure_driver.rb
>> index abbd353..20c6295 100644
>> --- a/server/lib/deltacloud/drivers/azure/azure_driver.rb
>> +++ b/server/lib/deltacloud/drivers/azure/azure_driver.rb
>> @@ -94,16 +94,22 @@ class AzureDriver<  Deltacloud::BaseDriver
>>   #--
>>   # Create Blob
>>   #--
>> +require 'ruby-debug'
>>     def create_blob(credentials, bucket_id, blob_id, blob_data, opts=nil)
>
> Default value for opts should be {}, so that replace_keys doesn't barf
> on a nil hash
>
> Other than that, and the issue of how to pass in metadata k/v pairs,
> looks good.
>
> David
>
>


Mime
View raw message