[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a

Garrett Holmstrom gholms at fedoraproject.org
Sun Jun 16 02:30:23 UTC 2013


The following commit has been merged in the master branch:
commit d5b119f8c47e573e22a7a40f187497ac7acbc97d
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Tue Feb 19 22:28:29 2013 -0800

    Add pagination support to ListUsers

diff --git a/euca2ools/commands/euare/listusers.py b/euca2ools/commands/euare/listusers.py
index 2e748db..879e3be 100644
--- a/euca2ools/commands/euare/listusers.py
+++ b/euca2ools/commands/euare/listusers.py
@@ -29,6 +29,7 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 from requestbuilder import Arg
+from requestbuilder.response import PaginatedResponse
 from . import EuareRequest, DELEGATE
 
 class ListUsers(EuareRequest):
@@ -39,6 +40,17 @@ class ListUsers(EuareRequest):
             DELEGATE]
     LIST_MARKERS = ['Users']
 
+    def main(self):
+        return PaginatedResponse(self, (None,), ('Groups',))
+
+    def prepare_for_page(self, page):
+        # Pages are defined by markers
+        self.params['Marker'] = page
+
+    def get_next_page(self, response):
+        if response.get('IsTruncated') == 'true':
+            return response['Marker']
+
     def print_result(self, result):
         for user in result.get('Users', []):
             print user['Arn']

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list