Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DEDF9E99A for ; Mon, 28 Jan 2013 17:55:35 +0000 (UTC) Received: (qmail 52570 invoked by uid 500); 28 Jan 2013 17:55:35 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 52554 invoked by uid 500); 28 Jan 2013 17:55:35 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 52544 invoked by uid 99); 28 Jan 2013 17:55:35 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jan 2013 17:55:35 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 84B518266F5; Mon, 28 Jan 2013 17:55:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: marios@apache.org To: commits@deltacloud.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: Fix for DTACLOUD-423 - override realms method for euca (no vpc/subnets) Message-Id: <20130128175535.84B518266F5@tyr.zones.apache.org> Date: Mon, 28 Jan 2013 17:55:35 +0000 (UTC) Updated Branches: refs/heads/master a62a0d3d6 -> e626bb61f Fix for DTACLOUD-423 - override realms method for euca (no vpc/subnets) https://issues.apache.org/jira/browse/DTACLOUD-423 Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/e626bb61 Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/e626bb61 Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/e626bb61 Branch: refs/heads/master Commit: e626bb61f5c939769d6204b69d307458ce23f486 Parents: a62a0d3 Author: marios Authored: Mon Jan 28 11:30:01 2013 +0200 Committer: marios Committed: Mon Jan 28 19:53:42 2013 +0200 ---------------------------------------------------------------------- .../drivers/eucalyptus/eucalyptus_driver.rb | 24 +++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e626bb61/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb ---------------------------------------------------------------------- diff --git a/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb b/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb index 7586052..a68b3cb 100644 --- a/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb +++ b/server/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb @@ -118,6 +118,30 @@ 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 + ec2.describe_availability_zones([opts[:id]]).collect do |realm| + realms << convert_realm(realm) unless realm.empty? + 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