You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by qu...@apache.org on 2017/09/26 04:26:28 UTC

libcloud git commit: Need to call `page` when using `GCEList` for pagination to work

Repository: libcloud
Updated Branches:
  refs/heads/trunk a83130139 -> 5892fa1be


Need to call `page` when using `GCEList` for pagination to work

Otherwise, the `if self.gce_params:` condition will evaluate to false
as the dict remains empty.

Closes #1095

Signed-off-by: Quentin Pradet <qu...@apache.org>


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

Branch: refs/heads/trunk
Commit: 5892fa1be32353278eaba58c288c6daf0a6c83c6
Parents: a831301
Author: Yap Sok Ann <so...@gmail.com>
Authored: Thu Jun 15 16:07:54 2017 +0700
Committer: Quentin Pradet <qu...@apache.org>
Committed: Tue Sep 26 08:25:39 2017 +0400

----------------------------------------------------------------------
 CHANGES.rst                     | 3 +++
 libcloud/compute/drivers/gce.py | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5892fa1b/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 1644367..527ecd4 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -18,6 +18,9 @@ Compute
 
 - [GCE] Support GCE node labels. (GITHUB-1115) [@maxlip]
 
+- [GCE] Fix `GCEList` pagination. (GITHUB-1095)
+  [Yap Sok Ann]
+
 Changes in Apache Libcloud 2.2.1
 --------------------------------
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/5892fa1b/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 7b052a2..737ed24 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -7619,10 +7619,10 @@ class GCENodeDriver(NodeDriver):
                   if no matching image is found.
         :rtype:   :class:`GCENodeImage` or ``None``
         """
-        project_images_pages = self.ex_list(
+        project_images_list = self.ex_list(
             self.list_images, ex_project=project, ex_include_deprecated=True)
         partial_match = []
-        for page in project_images_pages:
+        for page in project_images_list.page():
             for image in page:
                 if image.name == partial_name:
                     return image