incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH] Reworks GET BUCKET so that only get a full listing of blobs if a specific bucket is requested (and just list of bucket names otherwise) - azure, ec2, cloudfiles
Date Fri, 04 Feb 2011 23:07:30 GMT
On Thu, 2011-02-03 at 22:30 +0200, marios@redhat.com wrote:
> From: marios <marios@redhat.com>

ACK from me too. Just a minor nitpick to prove I read the patch: ;)

> --- a/server/lib/deltacloud/drivers/azure/azure_driver.rb
> +++ b/server/lib/deltacloud/drivers/azure/azure_driver.rb
> @@ -36,10 +36,15 @@ class AzureDriver < Deltacloud::BaseDriver
>      buckets = []
>      azure_connect(credentials)
>      safely do
> -      WAZ::Blobs::Container.list.each do |waz_container|
> -        buckets << convert_container(waz_container)
> -      end
> -    end
> +      unless (opts[:id].nil?)
> +        waz_bucket =  WAZ::Blobs::Container.find(opts[:id])
> +        buckets << convert_container(waz_bucket)
> +      else
> +        WAZ::Blobs::Container.list.each do |waz_container|
> +          buckets << Bucket.new({:id =>waz_container.name, :name => waz_container.name})
> +        end #container.list.each
> +      end #unless
> +    end #safely

I personally dislike marking end's that way. If they are truly needed to
find your way through the code, it's a strong hint that the code should
be broken up into smaller routines (though I don't think that that's the
case here)

David


Mime
View raw message