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/23 22:37:11 UTC

[1/2] git commit: For consistency and accuracy, rename "ex_associate_addresses" method in the EC2 driver to "ex_associate_address_with_node".

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 <to...@apache.org>
Authored: Wed Oct 23 22:32:59 2013 +0200
Committer: Tomaz Muraus <to...@apache.org>
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')


[2/2] git commit: Pep8 and fix ex_owner handling in the list_images method.

Posted by to...@apache.org.
Pep8 and fix ex_owner handling in the list_images method.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/77c69248
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/77c69248
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/77c69248

Branch: refs/heads/trunk
Commit: 77c69248da8235c554144b8a2b6bc4a23becaed4
Parents: adde1c5
Author: Tomaz Muraus <to...@apache.org>
Authored: Wed Oct 23 22:33:58 2013 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Wed Oct 23 22:33:58 2013 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/77c69248/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index a6cb70a..495f956 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -623,9 +623,9 @@ class BaseEC2NodeDriver(NodeDriver):
         state = findtext(element=element, xpath='status', namespace=NAMESPACE)
         description = findtext(element=element, xpath='description', namespace=NAMESPACE)
         return VolumeSnapshot(snapId, size=int(size), driver=self,
-                               extra={'volume_id': volId,
-                                        'description': description,
-                                        'state': state})
+                              extra={'volume_id': volId,
+                                     'description': description,
+                                     'state': state})
 
     def list_nodes(self, ex_node_ids=None):
         """
@@ -695,7 +695,7 @@ class BaseEC2NodeDriver(NodeDriver):
         params = {'Action': 'DescribeImages'}
 
         if ex_owner:
-            params.update({'Owner.1': owner})
+            params.update({'Owner.1': ex_owner})
 
         if ex_image_ids:
             params.update(self._pathlist('ImageId', ex_image_ids))
@@ -1311,7 +1311,7 @@ class BaseEC2NodeDriver(NodeDriver):
 
         response = self.connection.request(self.path, params=params).object
         public_ip = findtext(element=response, xpath='publicIp',
-                                namespace=NAMESPACE)
+                             namespace=NAMESPACE)
         return public_ip
 
     def ex_release_address(self, elastic_ip_address):