GET /v2/​{tenant_id}​/volumes?all_tenants=0 lists volumes in all tenants

Bug #1342046 reported by Ma, Tianxiao
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Ian Govett

Bug Description

When a user with admin role tries to list volumes belong to a given tenant, it does not work when all_tenants=0 is specified.
Requesting with all_tenants=0 should get the same response as requesting without all_tenants parameter.

Details:

OpenStack Release Version: IceHouse

Issue a REST API with an admin token (user's role in the specified tenant is admin).
- GET /v2/​{tenant_id}​/volumes
  Lists volumes in the specified tenant.

- GET /v2/​{tenant_id}​/volumes?all_tenants=0
  Lists volumes in all tenants.

- GET /v2/​{tenant_id}​/volumes?all_tenants=1
  Lists volumes in all tenants.

Revision history for this message
Thang Pham (thang-pham) wrote :

I believe the patch for bug #1334278 should fix this. If not, please re-open this bug.

Revision history for this message
Ma, Tianxiao (matx-r) wrote :

Sorry to reply late, I tried your patch set 5, but the problem is still there.

Ian Govett (igovett)
Changed in cinder:
assignee: nobody → Ian Govett (igovett)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/119785

Changed in cinder:
status: New → In Progress
Jay Bryant (jsbryant)
Changed in cinder:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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

commit ed2f3ad04410e1236eba95ef6d9025aa901ddbf3
Author: Ian Govett <email address hidden>
Date: Tue Sep 16 07:32:49 2014 -0400

    Fix a problem with 'volume list' when 'all_tenants=0'

    This change checks the value of 'all_tenants' and returns a list of volumes
    for all tenants when 'all_tenants' is 1 (or True). A tenant-specific volume
    list is returned when 'all_tenants' is 0 (or False).

    An InvalidInput exception is thrown if the 'all_tenants' value is not 0, 1,
    True, or False (case insensitive).

    Provided new unit tests for the get_all api which check the all_tenants, and
    limits parameters.

    Fixed pep8 compliance test fails with code being improperly indented, and
    changed calls using str() to use six.text_type()

    Change-Id: If0b8c343ee7e4e05c9aec89241458dbdf2e4734b
    Closes-Bug: #1342046

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-rc1 → 2014.2
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.