Comment 1 for bug 1504641

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

IIUC all the items of the list (=N) can *only* be fetched if:

    "osapi_max_limit" >= N

and if N > "osapi_max_limit" then N - "osapi_max_limit" items get truncated. The code [1] has this section:

    def _get_collection_links(self,
                              request,
                              items,
                              collection_name,
                              id_key="uuid"):
        """Retrieve 'next' link, if applicable. This is included if:
        1) 'limit' param is specified and equals the number of items.
        2) 'limit' param is specified but it exceeds CONF.osapi_max_limit,
        in this case the number of items is CONF.osapi_max_limit.
        3) 'limit' param is NOT specified but the number of items is
        CONF.osapi_max_limit.
        """
        links = []
        max_items = min(
            int(request.params.get("limit", CONF.osapi_max_limit)),
            CONF.osapi_max_limit)
        if max_items and max_items == len(items):

The "==" confuses me, I would expect "<" here.

References:
[1] https://github.com/openstack/nova/blob/c857d791a2f127e63c20ae8380498ff67e76051b/nova/api/openstack/common.py#L471