deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH] Fix for DTACLOUD-423 - override realms method for euca (no vpc/subnets)
Date Thu, 24 Jan 2013 17:05:21 GMT
From: marios <marios@redhat.com>

https://issues.apache.org/jira/browse/DTACLOUD-423

Signed-off-by: marios <marios@redhat.com>
---
 .../drivers/eucalyptus/eucalyptus_driver.rb        | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb b/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb
index 7586052..6ad1973 100644
--- a/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb
+++ b/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb
@@ -118,6 +118,29 @@ module Deltacloud
                   "Loadbalancer not supported in Eucalyptus", "")
         end
 
+        #override ec2 driver realms - euca API doesn't support vpc/subnet concepts
+        #http://docs.aws.amazon.com/AWSEC2/2009-04-04/DeveloperGuide/
+        def realms(credentials, opts={})
+          ec2 = new_client(credentials)
+          realms = []
+          safely do
+            if opts[:id] and !opts[:id].empty?
+              begin
+                realms << ec2.describe_availability_zones(opts[:id])
+              rescue => e
+                raise e unless e.message =~ /Invalid availability zone/
+                realms = []
+              end
+            else
+              realms = ec2.describe_availability_zones.collect do |realm|
+                convert_realm(realm) unless realm.empty?
+              end
+            end
+          end
+          realms
+        end
+
+
 	# override EC2 implementation; Eucalyptus implements the older definition of EC2 security
group;
 	# http://docs.amazonwebservices.com/AWSEC2/2009-07-15/APIReference/index.html?ApiReference-query-AuthorizeSecurityGroupIngress.html
         # if the rule specifies a source group, port&protocol will be ignored. And source
group and cidr range can't be mixed in a request
-- 
1.7.11.7


Mime
View raw message