Bug 888469 - [ovirt-engine-core] : list --max parameter issues
Summary: [ovirt-engine-core] : list --max parameter issues
Keywords:
Status: CLOSED DUPLICATE of bug 958726
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 3.3.0
Assignee: Mooli Tayer
QA Contact: Elena
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-18 18:30 UTC by Oded Ramraz
Modified: 2016-02-10 19:16 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-09 08:54:45 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 13950 0 None None None Never
oVirt gerrit 18043 0 None None None Never

Description Oded Ramraz 2012-12-18 18:30:17 UTC
Description of problem:

When giving bad input to list --max command I see wrong behavior:
1. when sending string as an input I get no error.
2. When sending negative numbers I get too detailed error ( see Additional Information ) 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:


[RHEVM shell (connected)]# list vms --max -2

error: 
status: 400
reason: Bad Request
detail: statementcallback; sql [select * from (select * from vms where ( vm guid in (select vms with tags.vm guid from  vms with tags  ))  order by vm name asc ) as t1 offset (1 -1) limit -2]; error: limit must not be negative; nested exception is org.postgresql.util.psqlexception: error: limit must not be negative

[RHEVM shell (connected)]# list vms --max string

id         : 014435b3-2dbb-4971-977b-002d4bd8acd4
name       : oded

id         : f5ec4710-655f-4535-8a26-0ef45bbc8e31
name       : t-1

id         : 0c373c97-0a72-4e4e-a9fd-7d7d906e9531
name       : Windows

Comment 1 Mooli Tayer 2013-06-27 12:21:26 UTC
Where did the parameter --max came from? 

I couldn't find any mention of it in documentation or code. maybe you meant --show-all ?

Also regarding 'string' it looks like invalid syntax, according to the docs a query should look something like:

[oVirt shell (connected)]# list vms --query "name=kuku*"

So IMO writing 
#list vms --max kuku
is just like writing:
#list vms --max
and like writing 
list vms
As all those parameters are unexpected and ignored.

The -2 is a different issue.

Please clarify what you meant regarding the parameters.

Thanks.

Comment 2 Mooli Tayer 2013-08-14 07:09:59 UTC
My mistake, this parameter certainly exists.

patch proposed updstream to limit --max arg to be a number > -1
(-1 means no limit) and return an error otherwise

Comment 4 Mooli Tayer 2013-09-09 08:54:45 UTC
Other patch already merged, abandoning changes.

*** This bug has been marked as a duplicate of bug 958726 ***


Note You need to log in before you can comment on or make changes to this bug.