deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH] Fix issue with empty realms returned from EC2 ('unavailable' realms shouldn't be reported to client)
Date Fri, 15 Jun 2012 10:12:29 GMT
On 06/15/12, marios@redhat.com wrote:

ACK.

> From: marios <marios@redhat.com>
> 
> 
> Signed-off-by: marios <marios@redhat.com>
> ---
>  server/lib/deltacloud/drivers/ec2/ec2_driver.rb |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> index 318db1a..7629ffa 100644
> --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> @@ -160,17 +160,19 @@ module Deltacloud
>  
>          def realms(credentials, opts={})
>            ec2 = new_client(credentials)
> +          realms = []
>            safely do
>              if opts[:id] and !opts[:id].empty?
> -              return ec2.describe_availability_zones([opts[:id]]).collect do |realm|
> -                convert_realm(realm)
> +              ec2.describe_availability_zones([opts[:id]]).collect do |realm|
> +                realms << convert_realm(realm) unless realm.empty?
>                end
>              else
> -              return ec2.describe_availability_zones.collect do |realm|
> -                convert_realm(realm)
> +              ec2.describe_availability_zones.collect do |realm|
> +                realms << convert_realm(realm) unless realm.empty?
>                end
>              end
>            end
> +          realms
>          end
>  
>          def create_image(credentials, opts={})
> -- 
> 1.7.6.5
> 

-- 
Michal Fojtik
Sr. Software Engineer, Deltacloud API (http://deltacloud.org)

Mime
View raw message