Updated Branches: refs/heads/trunk 6e96a8aee -> 77c69248d
For consistency and accuracy, rename "ex_associate_addresses" method in the EC2 driver to "ex_associate_address_with_node". Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/adde1c56 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/adde1c56 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/adde1c56 Branch: refs/heads/trunk Commit: adde1c56ef026df1836825374f53b1353c11b6c2 Parents: 6e96a8a Author: Tomaz Muraus <[email protected]> Authored: Wed Oct 23 22:32:59 2013 +0200 Committer: Tomaz Muraus <[email protected]> Committed: Wed Oct 23 22:32:59 2013 +0200 ---------------------------------------------------------------------- CHANGES | 6 ++++++ .../compute/create_ec2_node_and_associate_elastic_ip.py | 2 +- libcloud/compute/drivers/ec2.py | 10 +++++++++- libcloud/test/compute/test_ec2.py | 9 ++++++--- 4 files changed, 22 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/adde1c56/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index dbd9805..d47cf33 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,12 @@ Changes with Apache Libcloud in development ex_release_address. (LIBCLOUD-417) [Patrick Armstrong] + - For consistency and accuracy, rename "ex_associate_addresses" method in the + EC2 driver to "ex_associate_address_with_node". + + Note: Old method will continue to work until the next major release. + [Tomaz Muraus] + Changes with Apache Libcloud 0.14.0-beta2 *) Compute http://git-wip-us.apache.org/repos/asf/libcloud/blob/adde1c56/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py ---------------------------------------------------------------------- diff --git a/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py b/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py index 0f44143..5d2c65c 100644 --- a/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py +++ b/docs/examples/compute/create_ec2_node_and_associate_elastic_ip.py @@ -20,7 +20,7 @@ node = driver.create_node(name='test-node', image=image, size=size) # Here we allocate and associate an elastic IP elastic_ip = driver.ex_allocate_address() -driver.ex_associate_addresses(node, elastic_ip) +driver.ex_associate_address_with_node(node, elastic_ip) # When we are done with our elastic IP, we can disassociate from our # node, and release it http://git-wip-us.apache.org/repos/asf/libcloud/blob/adde1c56/libcloud/compute/drivers/ec2.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py index 7eecacc..a6cb70a 100644 --- a/libcloud/compute/drivers/ec2.py +++ b/libcloud/compute/drivers/ec2.py @@ -1365,7 +1365,7 @@ class BaseEC2NodeDriver(NodeDriver): return elastic_ip_addresses - def ex_associate_addresses(self, node, elastic_ip_address): + def ex_associate_address_with_node(self, node, elastic_ip_address): """ Associate an Elastic IP address with a particular node. @@ -1385,6 +1385,14 @@ class BaseEC2NodeDriver(NodeDriver): res = self.connection.request(self.path, params=params).object return self._get_boolean(res) + def ex_associate_addresses(self, node, elastic_ip_address): + """ + Note: This method has been deprecated in favor of + the ex_associate_address_with_node method. + """ + return self.ex_associate_address_with_node(node=node, + elastic_ip_address=elastic_ip_address) + def ex_disassociate_address(self, elastic_ip_address): """ Disassociate an Elastic IP address http://git-wip-us.apache.org/repos/asf/libcloud/blob/adde1c56/libcloud/test/compute/test_ec2.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py index 81da921..c52f63a 100644 --- a/libcloud/test/compute/test_ec2.py +++ b/libcloud/test/compute/test_ec2.py @@ -467,10 +467,13 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin): ret = self.driver.ex_release_address('1.2.3.4') self.assertTrue(ret) - def test_ex_associate_addresses(self): + def test_ex_associate_address_with_node(self): node = Node('i-4382922a', None, None, None, None, self.driver) - ret = self.driver.ex_associate_addresses(node, '1.2.3.4') - self.assertTrue(ret) + + ret1 = self.driver.ex_associate_address_with_node(node, '1.2.3.4') + ret2 = self.driver.ex_associate_addresses(node, '1.2.3.4') + self.assertTrue(ret1) + self.assertTrue(ret2) def test_ex_disassociate_address(self): ret = self.driver.ex_disassociate_address('1.2.3.4')
