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/10/24 14:02:37 UTC
[2/2] git commit: Fix ex_list_publis_ips in the CloudStack driver so
it works with basic zone.
Fix ex_list_publis_ips in the CloudStack driver so it works with basic zone.
Part of LIBCLOUD-418.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/160db53c
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/160db53c
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/160db53c
Branch: refs/heads/trunk
Commit: 160db53c0c77e5b2e5e3ded53647502df721fb0a
Parents: 66c17d0
Author: Tomaz Muraus <to...@apache.org>
Authored: Thu Oct 24 14:01:23 2013 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Thu Oct 24 14:01:23 2013 +0200
----------------------------------------------------------------------
libcloud/compute/drivers/cloudstack.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/160db53c/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index 92ce64f..2692f0b 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -631,7 +631,7 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
"""
List all volumes
- :param node: Only return volumns for the provided node.
+ :param node: Only return volumes for the provided node.
:type node: :class:`CloudStackNode`
:rtype: ``list`` of :class:`StorageVolume`
@@ -656,8 +656,14 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
:rtype: ``list`` of :class:`CloudStackAddress`
"""
- res = self._sync_request('listPublicIpAddresses')
ips = []
+
+ res = self._sync_request('listPublicIpAddresses')
+
+ # Workaround for basic zones
+ if not res:
+ return ips
+
for ip in res['publicipaddress']:
ips.append(CloudStackAddress(ip['id'], ip['ipaddress'], self))
return ips