yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #60466
[Bug 1656256] [NEW] limit=-1 doesn't work
Public bug reported:
newton code , we don't allow limit = -1 (API layer call db and
[root@cmabvt compute] # nova help hypervisor-list
usage: nova hypervisor-list [--matching <hostname>] [--marker <marker>]
[--limit <limit>]
List hypervisors. (Supported by API versions '2.0' - '2.latest') [hint: use
'--os-compute-api-version' flag to show help message for proper version]
Optional arguments:
--matching <hostname> List hypervisors matching the given <hostname>. If
matching is used limit and marker options will be
ignored.
--marker <marker> The last hypervisor of the previous page; displays
list of hypervisors after "marker".
--limit <limit> Maximum number of hypervisors to display. If limit ==
-1, all hypervisors will be displayed. If limit is
bigger than 'osapi_max_limit' option of Nova API,
limit 'osapi_max_limit' will be used instead.
[root@cmabvt compute] # nova hypervisor-list --limit -1
ERROR (BadRequest): Invalid input received: limit must be >= 0 (HTTP 400) (Request-ID: req-11889244-903f-446b-a712-241fada50e56)
this is because we have this validation here
def _get_int_param(request, param):
"""Extract integer param from request or fail."""
try:
int_param = utils.validate_integer(request.GET[param], param,
min_value=0)
except exception.InvalidInput as e:
raise webob.exc.HTTPBadRequest(explanation=e.format_message())
return int_param
** Affects: nova
Importance: Undecided
Assignee: jichenjc (jichenjc)
Status: New
** Changed in: nova
Assignee: (unassigned) => jichenjc (jichenjc)
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1656256
Title:
limit=-1 doesn't work
Status in OpenStack Compute (nova):
New
Bug description:
newton code , we don't allow limit = -1 (API layer call db and
[root@cmabvt compute] # nova help hypervisor-list
usage: nova hypervisor-list [--matching <hostname>] [--marker <marker>]
[--limit <limit>]
List hypervisors. (Supported by API versions '2.0' - '2.latest') [hint: use
'--os-compute-api-version' flag to show help message for proper version]
Optional arguments:
--matching <hostname> List hypervisors matching the given <hostname>. If
matching is used limit and marker options will be
ignored.
--marker <marker> The last hypervisor of the previous page; displays
list of hypervisors after "marker".
--limit <limit> Maximum number of hypervisors to display. If limit ==
-1, all hypervisors will be displayed. If limit is
bigger than 'osapi_max_limit' option of Nova API,
limit 'osapi_max_limit' will be used instead.
[root@cmabvt compute] # nova hypervisor-list --limit -1
ERROR (BadRequest): Invalid input received: limit must be >= 0 (HTTP 400) (Request-ID: req-11889244-903f-446b-a712-241fada50e56)
this is because we have this validation here
def _get_int_param(request, param):
"""Extract integer param from request or fail."""
try:
int_param = utils.validate_integer(request.GET[param], param,
min_value=0)
except exception.InvalidInput as e:
raise webob.exc.HTTPBadRequest(explanation=e.format_message())
return int_param
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1656256/+subscriptions
Follow ups