Merge "Set Resource.page limit to None"

This commit is contained in:
Jenkins
2015-02-15 00:41:14 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 4 deletions

View File

@@ -706,7 +706,7 @@ class Resource(collections.MutableMapping):
more_data = False
@classmethod
def page(cls, session, limit, marker=None, path_args=None, **params):
def page(cls, session, limit=None, marker=None, path_args=None, **params):
"""Get a one page response.
This method gets starting at ``marker`` with a maximum of ``limit``
@@ -714,7 +714,8 @@ class Resource(collections.MutableMapping):
:param session: The session to use for making this request.
:type session: :class:`~openstack.session.Session`
:param limit: The maximum amount of results to retrieve.
:param limit: The maximum amount of results to retrieve. The default
is to retrieve as many results as the service allows.
:param marker: The position in the list to begin requests from.
The type of value to use for ``marker`` depends on
the API being called.
@@ -724,7 +725,7 @@ class Resource(collections.MutableMapping):
:param dict params: Parameters to be passed into the underlying
:meth:`~openstack.session.Session.get` method.
:return: An array of :class:`Resource` objects.
:return: A list of dictionaries returned in the response body.
"""
filters = {}

View File

@@ -361,7 +361,7 @@ class ResourceTests(base.TestTransportBase):
path = fake_path
session.get.assert_called_with(path, params={}, service=None)
objs = FakeResource.page(session, None, None)
objs = FakeResource.page(session)
self.assertEqual(records, objs)
path = fake_base_path