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 6EADF9CA7 for ; Fri, 15 Jun 2012 10:29:19 +0000 (UTC) Received: (qmail 96636 invoked by uid 500); 15 Jun 2012 10:29:19 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 96596 invoked by uid 500); 15 Jun 2012 10:29:18 -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 96530 invoked by uid 99); 15 Jun 2012 10:29:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2012 10:29:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C1ED3119AF; Fri, 15 Jun 2012 10:29:14 +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 issue with empty realms returned from EC2 ('unavailable' realms shouldn't be reported to client) Message-Id: <20120615102914.C1ED3119AF@tyr.zones.apache.org> Date: Fri, 15 Jun 2012 10:29:14 +0000 (UTC) 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 Authored: Fri Jun 15 12:35:03 2012 +0300 Committer: marios 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={})