Author: tomaz
Date: Wed Mar 27 03:31:51 2013
New Revision: 1461400
URL: http://svn.apache.org/r1461400
Log:
Fix a bug in EC2 list_locations method - 'name' attribute didn't contain a
the right value.
Reported by Rudolf Streif on the mailing list.
Modified:
libcloud/branches/0.12.x/CHANGES
libcloud/branches/0.12.x/libcloud/compute/drivers/ec2.py
libcloud/branches/0.12.x/libcloud/test/compute/test_ec2.py
Modified: libcloud/branches/0.12.x/CHANGES
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.12.x/CHANGES?rev=1461400&r1=1461399&r2=1461400&view=diff
==============================================================================
--- libcloud/branches/0.12.x/CHANGES (original)
+++ libcloud/branches/0.12.x/CHANGES Wed Mar 27 03:31:51 2013
@@ -13,6 +13,10 @@ Changes with Apache Libcloud in developm
default one doesn't work. (LIBCLOUD-309)
[Chris Psaltis, Tomaz Muraus]
+ - Fix a bug in EC2 list_locations method - 'name' attribute didn't contain
a
+ the right value.
+ [Tomaz Muraus]
+
Changes with Apache Libcloud 0.12.3:
*) General
Modified: libcloud/branches/0.12.x/libcloud/compute/drivers/ec2.py
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/compute/drivers/ec2.py?rev=1461400&r1=1461399&r2=1461400&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/compute/drivers/ec2.py (original)
+++ libcloud/branches/0.12.x/libcloud/compute/drivers/ec2.py Wed Mar 27
03:31:51 2013
@@ -672,7 +672,7 @@ class BaseEC2NodeDriver(NodeDriver):
for index, availability_zone in \
enumerate(self.ex_list_availability_zones()):
locations.append(EC2NodeLocation(
- index, availability_zone, self.country, self,
+ index, availability_zone.name, self.country, self,
availability_zone)
)
return locations
Modified: libcloud/branches/0.12.x/libcloud/test/compute/test_ec2.py
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/test/compute/test_ec2.py?rev=1461400&r1=1461399&r2=1461400&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/test/compute/test_ec2.py (original)
+++ libcloud/branches/0.12.x/libcloud/test/compute/test_ec2.py Wed Mar 27
03:31:51 2013
@@ -28,6 +28,7 @@ from libcloud.compute.drivers.ec2 import
from libcloud.compute.drivers.ec2 import NimbusNodeDriver, EucNodeDriver
from libcloud.compute.drivers.ec2 import IdempotentParamError
from libcloud.compute.drivers.ec2 import REGION_DETAILS
+from libcloud.compute.drivers.ec2 import ExEC2AvailabilityZone
from libcloud.utils.py3 import urlparse
from libcloud.compute.base import Node, NodeImage, NodeSize, NodeLocation
from libcloud.compute.base import StorageVolume
@@ -151,7 +152,10 @@ class EC2Tests(LibcloudTestCase, TestCas
def test_list_location(self):
locations = self.driver.list_locations()
self.assertTrue(len(locations) > 0)
+ self.assertEqual(locations[0].name, 'eu-west-1a')
self.assertTrue(locations[0].availability_zone != None)
+ self.assertTrue(isinstance(locations[0].availability_zone,
+ ExEC2AvailabilityZone))
def test_list_security_groups(self):
groups = self.driver.ex_list_security_groups()