Bug 1303858

Summary: Incorrect output when running: cinder --os-volume-api-version 1 list --limit 0
Product: Red Hat OpenStack Reporter: lkuchlan <lkuchlan>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED WONTFIX QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0 (Liberty)CC: eharney, sgotliv, yeylon
Target Milestone: ---   
Target Release: 8.0 (Liberty)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-02 15:24:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description lkuchlan 2016-02-02 09:19:26 UTC
Description of problem:
Running cinder list when limit parameter is 0, displays the full list of volumes.
The issue is on api version 1, on api version 2 it works well   


Version-Release number of selected component (if applicable):
python-cinderclient-1.4.0-1.el7ost.noarch
python-cinder-7.0.1-5.el7ost.noarch
openstack-cinder-7.0.1-5.el7ost.noarch
python-cinderclient-1.4.0-1.el7ost.noarch

How reproducible:
100%


Steps to Reproduce:
1. Create several volumes
2. Run -> cinder --os-volume-api-version 1 list --limit 0


Actual results:
All volumes from list are displayed  

[stack@instack ~]$ cinder --os-volume-api-version 1 list --limit 0
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 0df1795c-4afb-46be-af05-c0d7deac4446 | available |      -       |  1   |      -      |  false   |             |
| 2bc3e83a-0274-447f-8172-66d0c8ac2858 | available |      -       |  1   |      -      |  false   |             |
| d0332391-2bb7-46e8-9089-29d3d835b472 | available |      -       |  1   |      -      |  false   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+


Expected results:
The volumes list should be empty

Comment 2 Sergey Gotliv 2016-02-02 15:03:05 UTC
*** Bug 1303857 has been marked as a duplicate of this bug. ***

Comment 3 Sergey Gotliv 2016-02-02 15:24:55 UTC
Default API version in Liberty is 2, so the only way for someone to hit that problem will be explicitly using v1, honestly I don't see why someone would like to downgrade API version. Using --limit 0 sounds like an extremely corner case to me, why would you like to run list command and explicitly ask not to get results?