deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [2/46] git commit: EC2: Fixed the way how we handle describe_availability_zones to be 1.9 compatible
Date Mon, 04 Jun 2012 11:21:06 GMT
EC2: Fixed the way how we handle describe_availability_zones to be 1.9 compatible


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/19ed5d9d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/19ed5d9d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/19ed5d9d

Branch: refs/heads/master
Commit: 19ed5d9d8ec9b42c77234445a6c16a8cb5ad3685
Parents: cf53169
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Thu May 31 11:22:44 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Jun 4 13:20:53 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/19ed5d9d/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
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


Mime
View raw message