libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [1/3] libcloud git commit: [LIBCLOUD-767] Fixed CloudStackAddress parameters
Date Sun, 08 Nov 2015 13:15:55 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 875d0e3bc -> 71d4e5718


[LIBCLOUD-767] Fixed CloudStackAddress parameters

Closes #627

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/b37548b9
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b37548b9
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b37548b9

Branch: refs/heads/trunk
Commit: b37548b92be75004db807170a3ee68aa023b720b
Parents: 875d0e3
Author: Atsushi Sasaki <atsaki01@gmail.com>
Authored: Sat Nov 7 22:35:22 2015 +0900
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Sun Nov 8 14:06:08 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b37548b9/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index 65572cf..7f7fd85 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -1454,8 +1454,8 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
 
         node = self._to_node(data=vm, public_ips=list(public_ips.keys()))
 
-        addresses = public_ips.items()
-        addresses = [CloudStackAddress(node, v, k) for k, v in addresses]
+        addresses = [CloudStackAddress(address_id, address, node.driver)
+                     for address, address_id in public_ips.items()]
         node.extra['ip_addresses'] = addresses
 
         rules = []

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b37548b9/libcloud/test/compute/test_cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_cloudstack.py b/libcloud/test/compute/test_cloudstack.py
index 7189821..5eacb59 100644
--- a/libcloud/test/compute/test_cloudstack.py
+++ b/libcloud/test/compute/test_cloudstack.py
@@ -590,6 +590,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.extra['ip_addresses']))
+        self.assertEqual(34000, node.extra['ip_addresses'][0].id)
 
     def test_ex_get_node_doesnt_exist(self):
         self.assertRaises(Exception, self.driver.ex_get_node(26), node_id=26)


Mime
View raw message