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 2015/02/20 21:19:41 UTC

[1/3] libcloud git commit: Update doap file.

Repository: libcloud
Updated Branches:
  refs/heads/trunk 0c062d384 -> 6a281fda5


Update doap file.


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

Branch: refs/heads/trunk
Commit: a3f9024e6f9ee5947d9d07614e2365164a9db5a0
Parents: 67dcedf
Author: Tomaz Muraus <to...@apache.org>
Authored: Wed Feb 18 20:14:10 2015 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Wed Feb 18 20:14:10 2015 +0100

----------------------------------------------------------------------
 doap_libcloud.rdf | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/a3f9024e/doap_libcloud.rdf
----------------------------------------------------------------------
diff --git a/doap_libcloud.rdf b/doap_libcloud.rdf
index 0a2c4f1..62baa4a 100644
--- a/doap_libcloud.rdf
+++ b/doap_libcloud.rdf
@@ -186,63 +186,70 @@
       <Version>
         <name>0.13.1</name>
         <created>2013-09-05</created>
-        <revision>0.13.1</revision>
+        <revision>v0.13.1</revision>
       </Version>
   </release>
   <release>
       <Version>
         <name>0.13.2</name>
         <created>2013-09-18</created>
-        <revision>0.13.2</revision>
+        <revision>v0.13.2</revision>
       </Version>
   </release>
   <release>
       <Version>
         <name>0.13.3</name>
         <created>2013-12-31</created>
-        <revision>0.13.3</revision>
+        <revision>v0.13.3</revision>
       </Version>
   </release>
   <release>
       <Version>
         <name>0.14.0-beta3</name>
         <created>2013-11-21</created>
-        <revision>0.14.0-beta3</revision>
+        <revision>v0.14.0-beta3</revision>
       </Version>
   </release>
   <release>
       <Version>
         <name>0.14.0</name>
         <created>2014-01-22</created>
-        <revision>0.14.0</revision>
+        <revision>v0.14.0</revision>
       </Version>
   </release>
   <release>
       <Version>
         <name>0.14.1</name>
         <created>2014-02-08</created>
-        <revision>0.14.1</revision>
+        <revision>v0.14.1</revision>
       </Version>
   </release>
   <release>
       <Version>
         <name>0.15.0</name>
         <created>2014-06-26</created>
-        <revision>0.15.0</revision>
+        <revision>v0.15.0</revision>
       </Version>
   </release>
   <release>
       <Version>
         <name>0.15.1</name>
         <created>2014-07-10</created>
-        <revision>0.15.1</revision>
+        <revision>v0.15.1</revision>
       </Version>
   </release>
   <release>
       <Version>
         <name>0.16.0</name>
         <created>2014-11-12</created>
-        <revision>0.16.0</revision>
+        <revision>v0.16.0</revision>
+      </Version>
+  </release>
+  <release>
+      <Version>
+        <name>0.17.0</name>
+        <created>2015-02-18</created>
+        <revision>v0.17.0</revision>
       </Version>
   </release>
     <repository>


[2/3] libcloud git commit: Merge branch 'trunk' of https://git-wip-us.apache.org/repos/asf/libcloud into trunk

Posted by to...@apache.org.
Merge branch 'trunk' of https://git-wip-us.apache.org/repos/asf/libcloud into trunk


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

Branch: refs/heads/trunk
Commit: 56882ffbffe9830f59990e5cef7dacd3c946d541
Parents: a3f9024 0c062d3
Author: Tomaz Muraus <to...@apache.org>
Authored: Thu Feb 19 22:11:33 2015 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Thu Feb 19 22:11:33 2015 +0100

----------------------------------------------------------------------
 demos/gce_demo.py               | 409 +++++++++++++++++++++++++++++------
 demos/gce_lb_demo.py            | 304 --------------------------
 libcloud/compute/drivers/gce.py |   3 +
 3 files changed, 344 insertions(+), 372 deletions(-)
----------------------------------------------------------------------



[3/3] libcloud git commit: Make list_volume_snapshot method in the EC2 driver conform to the base API.

Posted by to...@apache.org.
Make list_volume_snapshot method in the EC2 driver
conform to the base API.

Closes #451

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/6a281fda
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/6a281fda
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/6a281fda

Branch: refs/heads/trunk
Commit: 6a281fda51b405354e0264ab5e20357dfe5863e1
Parents: 56882ff
Author: Allard Hoeve <al...@byte.nl>
Authored: Thu Feb 12 14:49:15 2015 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Fri Feb 20 21:12:02 2015 +0100

----------------------------------------------------------------------
 CHANGES.rst                                     |  5 ++++
 libcloud/common/linode.py                       |  4 ++--
 libcloud/common/types.py                        | 20 ++++++++--------
 libcloud/compute/drivers/ec2.py                 |  5 ++--
 libcloud/compute/drivers/rimuhosting.py         |  4 ++--
 libcloud/compute/drivers/vcloud.py              |  6 ++---
 libcloud/storage/drivers/s3.py                  |  2 +-
 libcloud/test/compute/__init__.py               |  5 ++--
 .../compute/fixtures/ec2/describe_snapshots.xml | 24 +++++++++++++++++++-
 libcloud/test/compute/test_ec2.py               | 10 +++++++-
 libcloud/utils/dist.py                          |  3 +--
 11 files changed, 62 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index b2be624..bfb8a38 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,6 +20,11 @@ Compute
   (GITHUB-398, LIBCLOUD-637)
   [Allard Hoeve]
 
+- Fix ``list_volume_snapshots`` method in the EC2 driver so it comforms to the
+  base API.
+  (LIBCLOUD-664, GITHUB-451)
+  [Allard Hoeve]
+
 Changes with Apache Libcloud 0.17.0
 -----------------------------------
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/common/linode.py
----------------------------------------------------------------------
diff --git a/libcloud/common/linode.py b/libcloud/common/linode.py
index fb6ea2b..aba75f0 100644
--- a/libcloud/common/linode.py
+++ b/libcloud/common/linode.py
@@ -127,8 +127,8 @@ class LinodeResponse(JsonResponse):
             ret = []
             errs = []
             for obj in js:
-                if ("DATA" not in obj or "ERRORARRAY" not in obj
-                        or "ACTION" not in obj):
+                if ("DATA" not in obj or "ERRORARRAY" not in obj or
+                        "ACTION" not in obj):
                     ret.append(None)
                     errs.append(self.invalid)
                     continue

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/common/types.py
----------------------------------------------------------------------
diff --git a/libcloud/common/types.py b/libcloud/common/types.py
index 6020440..b5ff512 100644
--- a/libcloud/common/types.py
+++ b/libcloud/common/types.py
@@ -37,10 +37,10 @@ class LibcloudError(Exception):
         return self.__repr__()
 
     def __repr__(self):
-        return ("<LibcloudError in "
-                + repr(self.driver)
-                + " "
-                + repr(self.value) + ">")
+        return ("<LibcloudError in " +
+                repr(self.driver) +
+                " " +
+                repr(self.value) + ">")
 
 
 class MalformedResponseError(LibcloudError):
@@ -57,12 +57,12 @@ class MalformedResponseError(LibcloudError):
         return self.__repr__()
 
     def __repr__(self):
-        return ("<MalformedResponseException in "
-                + repr(self.driver)
-                + " "
-                + repr(self.value)
-                + ">: "
-                + repr(self.body))
+        return ("<MalformedResponseException in " +
+                repr(self.driver) +
+                " " +
+                repr(self.value) +
+                ">: " +
+                repr(self.body))
 
 
 class ProviderError(LibcloudError):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index df71eb6..fd7c98c 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -2407,8 +2407,9 @@ class BaseEC2NodeDriver(NodeDriver):
 
         return snapshot
 
-    def list_volume_snapshots(self, snapshot):
-        return self.list_snapshots(snapshot)
+    def list_volume_snapshots(self, volume):
+        return [snapshot for snapshot in self.list_snapshots(owner='self')
+                if snapshot.extra["volume_id"] == volume.id]
 
     def list_snapshots(self, snapshot=None, owner=None):
         """

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/compute/drivers/rimuhosting.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/rimuhosting.py b/libcloud/compute/drivers/rimuhosting.py
index acde574..f7cfdd7 100644
--- a/libcloud/compute/drivers/rimuhosting.py
+++ b/libcloud/compute/drivers/rimuhosting.py
@@ -151,8 +151,8 @@ class RimuHostingNodeDriver(NodeDriver):
                  name=order['domain_name'],
                  state=NodeState.RUNNING,
                  public_ips=(
-                     [order['allocated_ips']['primary_ip']]
-                     + order['allocated_ips']['secondary_ips']),
+                     [order['allocated_ips']['primary_ip']] +
+                     order['allocated_ips']['secondary_ips']),
                  private_ips=[],
                  driver=self.connection.driver,
                  extra={

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/compute/drivers/vcloud.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/vcloud.py b/libcloud/compute/drivers/vcloud.py
index d18d390..0ce10b3 100644
--- a/libcloud/compute/drivers/vcloud.py
+++ b/libcloud/compute/drivers/vcloud.py
@@ -581,9 +581,9 @@ class VCloudNodeDriver(NodeDriver):
             )
             vapps = [
                 (i.get('name'), i.get('href'))
-                for i in elms
-                if i.get('type') == 'application/vnd.vmware.vcloud.vApp+xml'
-                and i.get('name')
+                for i in elms if
+                i.get('type') == 'application/vnd.vmware.vcloud.vApp+xml' and
+                i.get('name')
             ]
 
             for vapp_name, vapp_href in vapps:

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/storage/drivers/s3.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/drivers/s3.py b/libcloud/storage/drivers/s3.py
index 60e5562..eca2910 100644
--- a/libcloud/storage/drivers/s3.py
+++ b/libcloud/storage/drivers/s3.py
@@ -729,7 +729,7 @@ class BaseS3StorageDriver(StorageDriver):
 
             if response.status != httplib.OK:
                 raise LibcloudError('Error fetching multipart uploads. '
-                                    'Got code: %s' % (response.status),
+                                    'Got code: %s' % response.status,
                                     driver=self)
 
             body = response.parse_body()

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/test/compute/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/__init__.py b/libcloud/test/compute/__init__.py
index 42e478c..1db7b2d 100644
--- a/libcloud/test/compute/__init__.py
+++ b/libcloud/test/compute/__init__.py
@@ -38,8 +38,9 @@ class TestCaseMixin(object):
         self.assertTrue(size.bandwidth is None or
                         isinstance(size.bandwidth, int))
         # Check that price values are ints, floats, or None.
-        self.assertTrue(size.price is None or isinstance(size.price, float)
-                        or isinstance(size.price, int))
+        self.assertTrue(size.price is None or
+                        isinstance(size.price, float) or
+                        isinstance(size.price, int))
 
     def test_list_images_response(self):
         images = self.driver.list_images()

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml b/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml
index b884c79..2faf38f 100644
--- a/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml
+++ b/libcloud/test/compute/fixtures/ec2/describe_snapshots.xml
@@ -40,4 +40,26 @@
          </tagSet>
       </item>
    </snapshotSet>
-</DescribeSnapshotsResponse>
\ No newline at end of file
+   <snapshotSet>
+      <item>
+         <snapshotId>snap-18349160</snapshotId>
+         <volumeId>vol-10ae5e2b</volumeId>
+         <status>pending</status>
+         <startTime>2014-09-15T16:00:30.000Z</startTime>
+         <progress>30%</progress>
+         <ownerId>1938218231</ownerId>
+         <volumeSize>15</volumeSize>
+         <description>Weekly backup</description>
+         <tagSet>
+            <item>
+               <key>Name</key>
+               <value>DB Backup 1</value>
+            </item>
+            <item>
+               <key>Key2</key>
+               <value>db_backup</value>
+            </item>
+         </tagSet>
+      </item>
+   </snapshotSet>
+</DescribeSnapshotsResponse>

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/test/compute/test_ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py
index e156565..1b79781 100644
--- a/libcloud/test/compute/test_ec2.py
+++ b/libcloud/test/compute/test_ec2.py
@@ -828,7 +828,7 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin):
     def test_list_snapshots(self):
         snaps = self.driver.list_snapshots()
 
-        self.assertEqual(len(snaps), 2)
+        self.assertEqual(len(snaps), 3)
 
         self.assertEqual('snap-428abd35', snaps[0].id)
         self.assertEqual('vol-e020df80', snaps[0].extra['volume_id'])
@@ -841,6 +841,14 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin):
         self.assertEqual('Weekly backup', snaps[1].extra['description'])
         self.assertEqual('DB Backup 1', snaps[1].extra['name'])
 
+    def test_list_volume_snapshots(self):
+        volume = self.driver.list_volumes()[0]
+        assert volume.id == 'vol-10ae5e2b'
+
+        snapshots = self.driver.list_volume_snapshots(volume)
+        self.assertEqual(len(snapshots), 1)
+        self.assertEqual(snapshots[0].id, 'snap-18349160')
+
     def test_destroy_snapshot(self):
         snap = VolumeSnapshot(id='snap-428abd35', size=10, driver=self.driver)
         resp = snap.destroy()

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6a281fda/libcloud/utils/dist.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/dist.py b/libcloud/utils/dist.py
index 4477e2a..01e523e 100644
--- a/libcloud/utils/dist.py
+++ b/libcloud/utils/dist.py
@@ -36,8 +36,7 @@ def _filter_names(names):
     # copy (likely a checkout) rather than a pristine export:
     for pattern in EXCLUDE_PATTERNS:
         names = [n for n in names
-                 if (not fnmatch.fnmatch(n, pattern))
-                 and (not n.endswith('.py'))]
+                 if not fnmatch.fnmatch(n, pattern) and not n.endswith('.py')]
     return names