You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/06/04 13:21:06 UTC
[2/46] git commit: EC2: Fixed the way how we handle
describe_availability_zones to be 1.9 compatible
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 <mf...@redhat.com>
Authored: Thu May 31 11:22:44 2012 +0200
Committer: Michal fojtik <mf...@redhat.com>
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