Parameter osapi_max_limit is always used by default even it's set in the configuration file

Bug #1487510 reported by Yuriy Nesenenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Yuriy Nesenenko

Bug Description

Parameter osapi_max_limit is always used by default even it's set in the configuration file. This happens because this parameter is passed to the function declaration in such functions common.get_pagination_params(params, max_limit=CONF.osapi_max_limit), common._get_limit_param(params, max_limit=CONF.osapi_max_limit),common. limited(items, request, max_limit=CONF.osapi_max_limit), common.limited_by_marker(items, request, max_limit=CONF.osapi_max_limit) etc

Changed in cinder:
assignee: nobody → Yuriy Nesenenko (ynesenenko)
Revision history for this message
Anton Arefiev (aarefiev) wrote :

The problem is default value max_limit is initialized before value from config is read. Default parameter values are always evaluated when, and only when, the “def” statement they belong to is executed. So default value is used all time.

Changed in cinder:
status: New → Confirmed
Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/216661
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=e894b3dd9285a1fb711aee63eb96be1cfe44375b
Submitter: Jenkins
Branch: master

commit e894b3dd9285a1fb711aee63eb96be1cfe44375b
Author: Yuriy Nesenenko <email address hidden>
Date: Tue Aug 25 13:55:56 2015 +0300

    Parameter osapi_max_limit is always used by default

    Default value max_limit is initialized before a value is read from
    the config file. Default parameter values are always evaluated when
    the “def” statement they belong to is executed. So parameter
    osapi_max_limit is always used by default even it's set in the
    configuration file.

    Change-Id: I1414667d30e98b56c5eb1b09b802bab823b37e2d
    Closes-Bug: #1487510

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.