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 core] Fixed client.create_bucket method to use :name instead of :id
Date Fri, 03 Jun 2011 06:34:25 GMT
nack - needs fixing before push:

On 02/06/11 13:27, mfojtik@redhat.com wrote:
> From: Michal Fojtik<mfojtik@redhat.com>
>
>
> Signed-off-by: Michal fojtik<mfojtik@redhat.com>
> ---
>   client/bin/deltacloudc              |    2 +-
>   client/deltacloud-client.gemspec    |    2 +-
>   client/lib/client_bucket_methods.rb |    4 ++--
>   3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/client/bin/deltacloudc b/client/bin/deltacloudc
> index f8ecdd0..41f2108 100755
> --- a/client/bin/deltacloudc
> +++ b/client/bin/deltacloudc
> @@ -217,7 +217,7 @@ if options[:collection] and options[:operation]
>     if options[:collection].eql?('buckets')
>       if options[:operation].eql?('create')
>           invalid_usage("Please specify an id for the new bucket with -i") unless options[:id]
> -        bucket = client.create_bucket('id'=>options[:id])
> +        bucket = client.create_bucket(:name=>options[:name])

must be a typo since options[:name] is null at this point - I think you 
meant:

bucket = client.create_bucket(:name=>options[:id])

Also, since we are changing this for create op, for the sake of 
consistency shouldn't we also change it for destroy op (so that destroy 
becomes client.destroy_bucket(:name=>'the_bucket_name')  - 
lib/client_bucket_methods.rb:13 and bin/deltacloudc:224.

Thanks for doing this though I must say I'm still not entirely clear 
what problem this fixes (I missed part of the conversation on irc 
yesterday - I know its something that the aeolus guys needed?)

thanks, marios

>           puts format(bucket)
>       elsif options[:operation].eql?('destroy')
>           invalid_usage("Please specify the bucket you wish to destroy with -i") unless
options[:id]
> diff --git a/client/deltacloud-client.gemspec b/client/deltacloud-client.gemspec
> index ca81d60..81b36d1 100644
> --- a/client/deltacloud-client.gemspec
> +++ b/client/deltacloud-client.gemspec
> @@ -23,7 +23,7 @@ Gem::Specification.new do |s|
>     s.email = 'deltacloud-users@lists.fedorahosted.org'
>     s.name = 'deltacloud-client'
>     s.description = %q{Deltacloud REST Client for API}
> -  s.version = '0.3.0'
> +  s.version = '0.3.1'
>     s.summary = %q{Deltacloud REST Client}
>     s.files = Dir['Rakefile', 'lib/**/*.rb', 'init.rb', 'bin/deltacloudc']
>     s.bindir = 'bin'
> diff --git a/client/lib/client_bucket_methods.rb b/client/lib/client_bucket_methods.rb
> index cc7dcff..1f71f52 100644
> --- a/client/lib/client_bucket_methods.rb
> +++ b/client/lib/client_bucket_methods.rb
> @@ -2,7 +2,7 @@ module ClientBucketMethods
>
>     def create_bucket(params)
>       obj = nil
> -    request(:post, "#{api_uri.to_s}/buckets", {:name =>  params['id'] }) do |response|
> +    request(:post, "#{api_uri.to_s}/buckets", {:name =>  params[:name] }) do |response|
>         handle_backend_error(response) if response.code!=201
>         obj = base_object(:bucket, response)
>       end
> @@ -51,4 +51,4 @@ module ClientBucketMethods
>       end
>     end
>
> -end
> \ No newline at end of file
> +end


Mime
View raw message