deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: Fix issue with empty realms returned from EC2 ('unavailable' realms shouldn't be reported to client)
Date Fri, 15 Jun 2012 10:29:14 GMT
Updated Branches:
  refs/heads/master 8c89662e2 -> 9b41a32d6


Fix issue with empty realms returned from EC2
('unavailable' realms shouldn't be reported to client)


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

Branch: refs/heads/master
Commit: 9b41a32d6b63519a84d071e272be96171c656db1
Parents: 8c89662
Author: marios <marios@redhat.com>
Authored: Fri Jun 15 12:35:03 2012 +0300
Committer: marios <marios@redhat.com>
Committed: Fri Jun 15 12:35:03 2012 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9b41a32d/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 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={})


Mime
View raw message