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 2013/12/17 21:49:28 UTC
git commit: LIBCLOUD-439: Be consistent with other drivers and use
underscores in the extra dictionary attribute names.
Updated Branches:
refs/heads/trunk a91706404 -> 4b76b9a79
LIBCLOUD-439: Be consistent with other drivers and use underscores in the extra
dictionary attribute names.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/4b76b9a7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4b76b9a7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4b76b9a7
Branch: refs/heads/trunk
Commit: 4b76b9a7980b0dabc027c0c0071f279615578efb
Parents: a917064
Author: Sebastien Goasguen <ru...@gmail.com>
Authored: Fri Dec 13 14:25:23 2013 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Dec 17 21:44:32 2013 +0100
----------------------------------------------------------------------
libcloud/compute/drivers/cloudstack.py | 10 +++++++---
libcloud/test/compute/test_cloudstack.py | 6 +++---
2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/4b76b9a7/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index 36dc37a..5a4996d 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -1472,14 +1472,18 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
created = data.get('created', False)
extra = {
- 'zoneid': zone_id,
+ 'zone_id': zone_id,
'ip_addresses': [],
'ip_forwarding_rules': [],
'port_forwarding_rules': [],
'password': password,
'keyname': keypair,
- 'securitygroup': security_groups,
- 'created': created
+ 'security_group': security_groups,
+ 'created': created,
+ 'image_id': data.get('templateid', None),
+ 'image_name': data.get('templatename', None),
+ 'size_id': data.get('serviceofferingid', None),
+ 'size_name': data.get('serviceofferingname', None)
}
node = CloudStackNode(id=id, name=name, state=state,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/4b76b9a7/libcloud/test/compute/test_cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_cloudstack.py b/libcloud/test/compute/test_cloudstack.py
index c038270..f808f74 100644
--- a/libcloud/test/compute/test_cloudstack.py
+++ b/libcloud/test/compute/test_cloudstack.py
@@ -105,7 +105,7 @@ class CloudStackCommonTestCase(TestCaseMixin):
self.assertEqual(node.name, 'fred')
self.assertEqual(node.public_ips, [])
self.assertEqual(node.private_ips, ['192.168.1.2'])
- self.assertEqual(node.extra['zoneid'], default_location.id)
+ self.assertEqual(node.extra['zone_id'], default_location.id)
def test_create_node_ex_security_groups(self):
size = self.driver.list_sizes()[0]
@@ -119,7 +119,7 @@ class CloudStackCommonTestCase(TestCaseMixin):
size=size,
ex_security_groups=sg)
self.assertEqual(node.name, 'test')
- self.assertEqual(node.extra['securitygroup'], sg)
+ self.assertEqual(node.extra['security_group'], sg)
self.assertEqual(node.id, 'fc4fd31a-16d3-49db-814a-56b39b9ef986')
def test_create_node_ex_keyname(self):
@@ -247,7 +247,7 @@ class CloudStackCommonTestCase(TestCaseMixin):
self.assertEqual(2, len(nodes))
self.assertEqual('test', nodes[0].name)
self.assertEqual('2600', nodes[0].id)
- self.assertEqual([], nodes[0].extra['securitygroup'])
+ self.assertEqual([], nodes[0].extra['security_group'])
self.assertEqual(None, nodes[0].extra['keyname'])
def test_list_locations(self):