You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/02/16 20:26:08 UTC
svn commit: r1071367 - in /incubator/libcloud/trunk: libcloud/drivers/ec2.py
test/fixtures/ec2/describe_instances.xml test/test_ec2.py
Author: tomaz
Date: Wed Feb 16 19:26:08 2011
New Revision: 1071367
URL: http://svn.apache.org/viewvc?rev=1071367&view=rev
Log:
Use ipAddress and privateIpAddress attribute for the node public and private ip
correspondingly,
Modified:
incubator/libcloud/trunk/libcloud/drivers/ec2.py
incubator/libcloud/trunk/test/fixtures/ec2/describe_instances.xml
incubator/libcloud/trunk/test/test_ec2.py
Modified: incubator/libcloud/trunk/libcloud/drivers/ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/ec2.py?rev=1071367&r1=1071366&r2=1071367&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/ec2.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/ec2.py Wed Feb 16 19:26:08 2011
@@ -351,8 +351,8 @@ class EC2NodeDriver(NodeDriver):
id=self._findtext(element, 'instanceId'),
name=self._findtext(element, 'instanceId'),
state=state,
- public_ip=[self._findtext(element, 'dnsName')],
- private_ip=[self._findtext(element, 'privateDnsName')],
+ public_ip=[self._findtext(element, 'ipAddress')],
+ private_ip=[self._findtext(element, 'privateIpAddress')],
driver=self.connection.driver,
extra={
'dns_name': self._findattr(element, "dnsName"),
Modified: incubator/libcloud/trunk/test/fixtures/ec2/describe_instances.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ec2/describe_instances.xml?rev=1071367&r1=1071366&r2=1071367&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ec2/describe_instances.xml (original)
+++ incubator/libcloud/trunk/test/fixtures/ec2/describe_instances.xml Wed Feb 16 19:26:08 2011
@@ -20,6 +20,8 @@
<privateDnsName/>
<dnsName/>
<reason/>
+ <privateIpAddress>1.2.3.5</privateIpAddress>
+ <ipAddress>1.2.3.5</ipAddress>
<amiLaunchIndex>0</amiLaunchIndex>
<productCodes/>
<instanceType>m1.small</instanceType>
Modified: incubator/libcloud/trunk/test/test_ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/test_ec2.py?rev=1071367&r1=1071366&r2=1071367&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/test_ec2.py (original)
+++ incubator/libcloud/trunk/test/test_ec2.py Wed Feb 16 19:26:08 2011
@@ -88,6 +88,7 @@ class EC2Tests(unittest.TestCase, TestCa
def test_list_nodes(self):
node = self.driver.list_nodes()[0]
self.assertEqual(node.id, 'i-4382922a')
+ self.assertEqual(len(node.public_ip), 1)
def test_list_location(self):
locations = self.driver.list_locations()