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/11/14 23:55:18 UTC
[1/3] git commit: Update CHANGES.
Updated Branches:
refs/heads/trunk 1c9027ced -> d988c473d
Update CHANGES.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/00986176
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/00986176
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/00986176
Branch: refs/heads/trunk
Commit: 00986176fc29921ba5b28dca9113bb61339b1121
Parents: 1c9027c
Author: Tomaz Muraus <to...@apache.org>
Authored: Thu Nov 14 23:34:59 2013 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Thu Nov 14 23:34:59 2013 +0100
----------------------------------------------------------------------
CHANGES | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/00986176/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 0ed78d4..5294705 100644
--- a/CHANGES
+++ b/CHANGES
@@ -83,6 +83,9 @@ Changes with Apache Libcloud in development
doesn't have 'diskofferingid' attribute. (LIBCLOUD-435)
[DaeMyung Kang]
+ - Add new c3 instance types to the EC2 driver.
+ [Tomaz Muraus]
+
*) Storage
- Add a new driver for KT UCloud based on the OpenStack Swift driver.
[3/3] git commit: Fix an issue with the ex_list_keypairs and
ex_list_security_groups method in the CloudStack driver which caused an
exception to be thrown if the API returned no keypairs / security groups.
Posted by to...@apache.org.
Fix an issue with the ex_list_keypairs and ex_list_security_groups method
in the CloudStack driver which caused an exception to be thrown if the API
returned no keypairs / security groups.
Reported by Carlos Reategui, part of LIBCLOUD-432.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/d988c473
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d988c473
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d988c473
Branch: refs/heads/trunk
Commit: d988c473dabdc91712ab0653fe71606d7254f2bc
Parents: b8195a1
Author: Tomaz Muraus <to...@apache.org>
Authored: Thu Nov 14 23:51:13 2013 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Thu Nov 14 23:51:13 2013 +0100
----------------------------------------------------------------------
CHANGES | 6 ++++++
libcloud/compute/drivers/cloudstack.py | 9 ++++++---
.../fixtures/cloudstack/listSSHKeyPairs_no_keys.json | 1 +
.../cloudstack/listSecurityGroups_no_groups.json | 1 +
libcloud/test/compute/test_cloudstack.py | 11 +++++++++++
5 files changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d988c473/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 5294705..839f5af 100644
--- a/CHANGES
+++ b/CHANGES
@@ -86,6 +86,12 @@ Changes with Apache Libcloud in development
- Add new c3 instance types to the EC2 driver.
[Tomaz Muraus]
+ - Fix an issue with the ex_list_keypairs and ex_list_security_groups method
+ in the CloudStack driver which caused an exception to be thrown if the API
+ returned no keypairs / security groups.
+ (LIBCLOUD-432)
+ [Carlos Reategui, Tomaz Muraus]
+
*) Storage
- Add a new driver for KT UCloud based on the OpenStack Swift driver.
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d988c473/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index e116155..84073b7 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -904,7 +904,8 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
extra_args = kwargs.copy()
res = self._sync_request('listSSHKeyPairs', **extra_args)
- return res['sshkeypair']
+ keypairs = res.get('sshkeypair', [])
+ return keypairs
def ex_create_keypair(self, name, **kwargs):
"""
@@ -1050,8 +1051,10 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
:rtype ``list``
"""
extra_args = kwargs
- return self._sync_request('listSecurityGroups',
- **extra_args)['securitygroup']
+ res = self._sync_request('listSecurityGroups', **extra_args)
+
+ security_groups = res.get('securitygroup', [])
+ return security_groups
def ex_create_security_group(self, name, **kwargs):
"""
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d988c473/libcloud/test/compute/fixtures/cloudstack/listSSHKeyPairs_no_keys.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/cloudstack/listSSHKeyPairs_no_keys.json b/libcloud/test/compute/fixtures/cloudstack/listSSHKeyPairs_no_keys.json
new file mode 100644
index 0000000..ccc9283
--- /dev/null
+++ b/libcloud/test/compute/fixtures/cloudstack/listSSHKeyPairs_no_keys.json
@@ -0,0 +1 @@
+{"listsshkeypairsresponse":{}}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d988c473/libcloud/test/compute/fixtures/cloudstack/listSecurityGroups_no_groups.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/cloudstack/listSecurityGroups_no_groups.json b/libcloud/test/compute/fixtures/cloudstack/listSecurityGroups_no_groups.json
new file mode 100644
index 0000000..d3c6a01
--- /dev/null
+++ b/libcloud/test/compute/fixtures/cloudstack/listSecurityGroups_no_groups.json
@@ -0,0 +1 @@
+{ "listsecuritygroupsresponse" : {} }
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d988c473/libcloud/test/compute/test_cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_cloudstack.py b/libcloud/test/compute/test_cloudstack.py
index 546b182..dde40db 100644
--- a/libcloud/test/compute/test_cloudstack.py
+++ b/libcloud/test/compute/test_cloudstack.py
@@ -284,6 +284,11 @@ class CloudStackNodeDriverTest(unittest.TestCase, TestCaseMixin):
self.assertEqual(keypairs[0]['name'], 'cs-keypair')
self.assertEqual(keypairs[0]['fingerprint'], fingerprint)
+ def test_ex_list_keypairs_no_keypair_key(self):
+ CloudStackMockHttp.fixture_tag = 'no_keys'
+ keypairs = self.driver.ex_list_keypairs()
+ self.assertEqual(keypairs, [])
+
def test_ex_create_keypair(self):
self.assertRaises(
LibcloudError,
@@ -322,6 +327,12 @@ class CloudStackNodeDriverTest(unittest.TestCase, TestCaseMixin):
self.assertEqual(groups[0]['name'], 'default')
self.assertEqual(groups[1]['name'], 'mongodb')
+ def test_ex_list_security_groups_no_securitygroup_key(self):
+ CloudStackMockHttp.fixture_tag = 'no_groups'
+
+ groups = self.driver.ex_list_security_groups()
+ self.assertEqual(groups, [])
+
def test_ex_create_security_group(self):
group = self.driver.ex_create_security_group(name='MySG')
self.assertEqual(group['name'], 'MySG')
[2/3] git commit: Fix invalid docstring.
Posted by to...@apache.org.
Fix invalid docstring.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b8195a19
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b8195a19
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b8195a19
Branch: refs/heads/trunk
Commit: b8195a19418578e61b90240f9a5fe8f9174717f3
Parents: 0098617
Author: Tomaz Muraus <to...@apache.org>
Authored: Thu Nov 14 23:38:25 2013 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Thu Nov 14 23:38:25 2013 +0100
----------------------------------------------------------------------
libcloud/compute/drivers/cloudstack.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b8195a19/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index 2692f0b..e116155 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -899,7 +899,7 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
:type domainid: ``str``
:return: A list of keypair dictionaries
- :rtype: :class:`dict`
+ :rtype: ``list`` of ``dict``
"""
extra_args = kwargs.copy()