Repository: libcloud Updated Branches: refs/heads/trunk 13c38debe -> 997946761
Add network_association_id to ex_list_public_ips and CloudstackAddress object Closes #327 Signed-off-by: Sebastien Goasguen <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/99794676 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/99794676 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/99794676 Branch: refs/heads/trunk Commit: 9979467611edde4ffdfe92ebb8d4c0f2168bb669 Parents: 13c38de Author: Roeland Kuipers <[email protected]> Authored: Thu Jun 26 18:50:03 2014 +0200 Committer: Sebastien Goasguen <[email protected]> Committed: Fri Jun 27 13:34:56 2014 +0200 ---------------------------------------------------------------------- libcloud/compute/drivers/cloudstack.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/99794676/libcloud/compute/drivers/cloudstack.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py index 921b68e..d4c7173 100644 --- a/libcloud/compute/drivers/cloudstack.py +++ b/libcloud/compute/drivers/cloudstack.py @@ -339,12 +339,24 @@ class CloudStackNode(Node): class CloudStackAddress(object): """ A public IP address. + + :param id: UUID of the Public IP + :type id: ``str`` + + :param address: The public IP address + :type address: ``str`` + + :param associated_network_id: The ID of the network where this address + has been associated with + :type associated_network_id: ``str`` """ - def __init__(self, id, address, driver): + def __init__(self, id, address, driver, associated_network_id=None,): + self.id = id self.address = address self.driver = driver + self.associated_network_id = associated_network_id def release(self): self.driver.ex_release_public_ip(address=self) @@ -1351,7 +1363,10 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): return ips for ip in res['publicipaddress']: - ips.append(CloudStackAddress(ip['id'], ip['ipaddress'], self)) + ips.append(CloudStackAddress(ip['id'], + ip['ipaddress'], + self, + ip['associatednetworkid'])) return ips def ex_allocate_public_ip(self, location=None):
