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 B0C79C73C for ; Mon, 4 Jun 2012 11:21:07 +0000 (UTC) Received: (qmail 50287 invoked by uid 500); 4 Jun 2012 11:21:07 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 50224 invoked by uid 500); 4 Jun 2012 11:21:07 -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 50041 invoked by uid 99); 4 Jun 2012 11:21:06 -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, 04 Jun 2012 11:21:06 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9275FFBF1; Mon, 4 Jun 2012 11:21:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mfojtik@apache.org To: commits@deltacloud.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [2/46] git commit: EC2: Fixed the way how we handle describe_availability_zones to be 1.9 compatible Message-Id: <20120604112106.9275FFBF1@tyr.zones.apache.org> Date: Mon, 4 Jun 2012 11:21:06 +0000 (UTC) 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 Authored: Thu May 31 11:22:44 2012 +0200 Committer: Michal fojtik 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