deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/3] EC2: Fixed the way how we handle describe_availability_zones to be 1.9 compatible
Date Thu, 31 May 2012 09:27:55 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index f7ef826..6454cce 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -159,10 +159,15 @@ module Deltacloud
 
         def realms(credentials, opts={})
           ec2 = new_client(credentials)
-          zone_id = opts ? opts[:id] : nil
           safely do
-            return ec2.describe_availability_zones(zone_id).collect do |realm|
-              convert_realm(realm)
+            if opts[:id] and !opts[:id].empty?
+              return ec2.describe_availability_zones([opts[:id]]).collect do |realm|
+                convert_realm(realm)
+              end
+            else
+              return ec2.describe_availability_zones.collect do |realm|
+                convert_realm(realm)
+              end
             end
           end
         end
-- 
1.7.10.2


Mime
View raw message