From b51c86973cc65d72db072e31bb49aaae2acd415f Mon Sep 17 00:00:00 2001 From: junboli Date: Tue, 17 Oct 2017 14:06:23 +0800 Subject: [PATCH] Delete limited_by_marker from api/common.py The function limited_by_marker seems unused, untested and hasn't been edited in a significant manner. This patch removes it. Change-Id: If24f2b831299d20babd2f4e181e95618bf30c670 --- manila/api/common.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/manila/api/common.py b/manila/api/common.py index 412c71d7f4..cda216fb7c 100644 --- a/manila/api/common.py +++ b/manila/api/common.py @@ -136,32 +136,6 @@ def limited(items, request, max_limit=CONF.osapi_max_limit): return items[offset:range_end] -def limited_by_marker(items, request, max_limit=CONF.osapi_max_limit): - """Return a slice of items according to the requested marker and limit.""" - params = get_pagination_params(request) - - limit = params.get('limit', max_limit) - marker = params.get('marker') - - limit = min(max_limit, limit) - start_index = 0 - if marker: - start_index = -1 - for i, item in enumerate(items): - if 'flavorid' in item: - if item['flavorid'] == marker: - start_index = i + 1 - break - elif item['id'] == marker or item.get('uuid') == marker: - start_index = i + 1 - break - if start_index < 0: - msg = _('marker [%s] not found') % marker - raise webob.exc.HTTPBadRequest(explanation=msg) - range_end = start_index + limit - return items[start_index:range_end] - - def remove_version_from_href(href): """Removes the first api version from the href.