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 2014/01/14 15:02:27 UTC

[1/3] git commit: Update NOTICE file.

Updated Branches:
  refs/heads/trunk dc8dfdfc3 -> eacb98947


Update NOTICE file.


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

Branch: refs/heads/trunk
Commit: 4403766e3cf4262ddec2ffee217b3862fb8c2baf
Parents: dc8dfdf
Author: Tomaz Muraus <to...@apache.org>
Authored: Tue Jan 14 05:02:31 2014 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Jan 14 05:02:31 2014 +0100

----------------------------------------------------------------------
 NOTICE | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/4403766e/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 3a62dab..5571eb0 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,7 +1,7 @@
 Apache Libcloud
-Copyright (c) 2010 The Apache Software Foundation
+Copyright (c) 2010-2014 The Apache Software Foundation
 
-This product includes software developed by
+This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
 This product includes software developed by


[3/3] git commit: Fix lint and object instantiation.

Posted by to...@apache.org.
Fix lint and object instantiation.


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

Branch: refs/heads/trunk
Commit: eacb989478158c940d0dc9167e2bb4e71eaa2478
Parents: 05252f6
Author: Tomaz Muraus <to...@apache.org>
Authored: Tue Jan 14 14:57:34 2014 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Jan 14 14:57:34 2014 +0100

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/eacb9894/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index c96d1e9..b76699f 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -2955,7 +2955,8 @@ class BaseEC2NodeDriver(NodeDriver):
         warnings.warn('This method has been deprecated in favor of '
                       'delete_key_pair method')
 
-        keypair = KeyPair(name=keypair, driver=self, public_key='', fingerprint='')
+        keypair = KeyPair(name=keypair, public_key=None, fingerprint=None,
+                          driver=self)
 
         return self.delete_key_pair(keypair)
 


[2/3] git commit: [LIBCLOUD-492] Fix delete_key_pair method in the EC2 driver.

Posted by to...@apache.org.
[LIBCLOUD-492] Fix delete_key_pair method in the EC2 driver.

The API expects a key pair name and not a key pair object.

Signed-off-by: Tomaz Muraus <to...@apache.org>


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

Branch: refs/heads/trunk
Commit: 05252f652d05ab1eb4e0425ec45dfc569ae33124
Parents: 4403766
Author: gigimon <gi...@gmail.com>
Authored: Tue Jan 14 14:18:43 2014 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Jan 14 14:55:26 2014 +0100

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py                 |  6 +++--
 .../fixtures/ec2/associate_vpc_address.xml      |  2 +-
 .../compute/fixtures/ec2/delete_key_pair.xml    |  4 ++++
 libcloud/test/compute/test_ec2.py               | 23 +++++++++++---------
 4 files changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/05252f65/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index 164fd88..c96d1e9 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -1549,7 +1549,7 @@ class BaseEC2NodeDriver(NodeDriver):
     def delete_key_pair(self, key_pair):
         params = {
             'Action': 'DeleteKeyPair',
-            'KeyName': key_pair
+            'KeyName': key_pair.name
         }
         result = self.connection.request(self.path, params=params).object
         element = findtext(element=result, xpath='return',
@@ -2955,7 +2955,9 @@ class BaseEC2NodeDriver(NodeDriver):
         warnings.warn('This method has been deprecated in favor of '
                       'delete_key_pair method')
 
-        return self.delete_key_pair(name=keypair)
+        keypair = KeyPair(name=keypair, driver=self, public_key='', fingerprint='')
+
+        return self.delete_key_pair(keypair)
 
     def ex_import_keypair_from_string(self, name, key_material):
         """

http://git-wip-us.apache.org/repos/asf/libcloud/blob/05252f65/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml b/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml
index 46433e2..21348ed 100644
--- a/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml
+++ b/libcloud/test/compute/fixtures/ec2/associate_vpc_address.xml
@@ -1,5 +1,5 @@
 <AssociateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2013-10-15/">
-    <requestId>1b3bf0d9-6c51-4443-a218-f25ecdc98c2a</requestId>
+    <requestId>s132fsz2-6cdg-4ox3-a148-lpqnvdc98c2a</requestId>
     <return>true</return>
     <associationId>eipassoc-167a8073</associationId>
 </AssociateAddressResponse>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/libcloud/blob/05252f65/libcloud/test/compute/fixtures/ec2/delete_key_pair.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/ec2/delete_key_pair.xml b/libcloud/test/compute/fixtures/ec2/delete_key_pair.xml
new file mode 100644
index 0000000..3e605b0
--- /dev/null
+++ b/libcloud/test/compute/fixtures/ec2/delete_key_pair.xml
@@ -0,0 +1,4 @@
+<DeleteKeyPairResponse xmlns="http://ec2.amazonaws.com/doc/2013-10-15/">
+    <requestId>59dbff89-35bd-4eac-99ed-be587</requestId>
+    <return>true</return>
+</DeleteKeyPairResponse>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/libcloud/blob/05252f65/libcloud/test/compute/test_ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py
index e0af93d..2a8fd6e 100644
--- a/libcloud/test/compute/test_ec2.py
+++ b/libcloud/test/compute/test_ec2.py
@@ -524,23 +524,26 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin):
         keys = self.driver.ex_describe_all_keypairs()
         self.assertEqual(keys, ['gsg-keypair'])
 
-    def test_ex_describe_keypairs(self):
-        keypair1 = self.driver.ex_describe_keypair('gsg-keypair')
+    def test_list_key_pairs(self):
+        keypair1 = self.driver.list_key_pairs()[0]
+
+        self.assertEqual(keypair1.name, 'gsg-keypair')
+        self.assertEqual(keypair1.fingerprint, null_fingerprint)
 
         # Test backward compatibility
         keypair2 = self.driver.ex_describe_keypairs('gsg-keypair')
 
-        self.assertEqual(keypair1['keyName'], 'gsg-keypair')
-        self.assertEqual(keypair1['keyFingerprint'], null_fingerprint)
         self.assertEqual(keypair2['keyName'], 'gsg-keypair')
         self.assertEqual(keypair2['keyFingerprint'], null_fingerprint)
 
-    def ex_delete_key_pair(self):
-        success = self.driver.delete_key_pair('testkey')
+    def test_delete_key_pair(self):
+        keypair = self.driver.list_key_pairs()[0]
+        success = self.driver.delete_key_pair(keypair)
+
         self.assertTrue(success)
 
         # Test old and deprecated method
-        resp = self.driver.ex_delete_keypair('testkey')
+        resp = self.driver.ex_delete_keypair('gsg-keypair')
         self.assertTrue(resp)
 
     def test_ex_describe_tags(self):
@@ -1256,10 +1259,10 @@ class EC2MockHttp(MockHttpTestCase):
         body = self.fixtures.load('deregister_image.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _DeleteKeypair(self, method, url, body, headers):
-        self.assertUrlContainsQueryParams(url, {'KeyPair': 'testkey'})
+    def _DeleteKeyPair(self, method, url, body, headers):
+        self.assertUrlContainsQueryParams(url, {'KeyName': 'gsg-keypair'})
 
-        body = self.fixtures.load('delete_keypair.xml')
+        body = self.fixtures.load('delete_key_pair.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
     def _ModifyImageAttribute(self, method, url, body, headers):