libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [1/2] libcloud git commit: [LIBCLOUD-766] Unique node.public_ips returned by CloudStack ex_get_node and list_nodes.
Date Tue, 10 Nov 2015 16:21:08 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk ae85479e8 -> 800189eac


[LIBCLOUD-766] Unique node.public_ips returned by CloudStack ex_get_node and
list_nodes.

Closes #626

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/455a279f
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/455a279f
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/455a279f

Branch: refs/heads/trunk
Commit: 455a279f25654c4fcca9a516d835b0c0e1a33907
Parents: ae85479
Author: Atsushi Sasaki <atsaki01@gmail.com>
Authored: Sat Nov 7 21:50:16 2015 +0900
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Tue Nov 10 17:13:15 2015 +0100

----------------------------------------------------------------------
 libcloud/compute/drivers/cloudstack.py   | 3 ++-
 libcloud/test/compute/test_cloudstack.py | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/455a279f/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index dd8f25e..73c316f 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -4653,7 +4653,8 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
             extra['tags'] = self._get_resource_tags(data['tags'])
 
         node = CloudStackNode(id=id, name=name, state=state,
-                              public_ips=public_ips, private_ips=private_ips,
+                              public_ips=list(set(public_ips)),
+                              private_ips=private_ips,
                               driver=self, extra=extra)
         return node
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/455a279f/libcloud/test/compute/test_cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_cloudstack.py b/libcloud/test/compute/test_cloudstack.py
index 5eacb59..a0cb898 100644
--- a/libcloud/test/compute/test_cloudstack.py
+++ b/libcloud/test/compute/test_cloudstack.py
@@ -583,6 +583,8 @@ class CloudStackCommonTestCase(TestCaseMixin):
         self.assertEqual('2600', nodes[0].id)
         self.assertEqual([], nodes[0].extra['security_group'])
         self.assertEqual(None, nodes[0].extra['key_name'])
+        self.assertEqual(1, len(nodes[0].public_ips))
+        self.assertEqual('1.1.1.116', nodes[0].public_ips[0])
 
     def test_ex_get_node(self):
         node = self.driver.ex_get_node(2600)
@@ -590,6 +592,8 @@ class CloudStackCommonTestCase(TestCaseMixin):
         self.assertEqual('2600', node.id)
         self.assertEqual([], node.extra['security_group'])
         self.assertEqual(None, node.extra['key_name'])
+        self.assertEqual(1, len(node.public_ips))
+        self.assertEqual('1.1.1.116', node.public_ips[0])
         self.assertEqual(1, len(node.extra['ip_addresses']))
         self.assertEqual(34000, node.extra['ip_addresses'][0].id)
 


Mime
View raw message