group list doesn't parse 'all_tenants' parameter correctly

Bug #2034248 reported by Rajat Dhasmana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
In Progress
Undecided
Unassigned

Bug Description

If we create a group in project A and try to list the groups from project B with all_tenants 0, it still shows the group record from project A which it shouldn't.

Reproducer:

1. As an admin, create a group type and a volume type

2. login with demo user and create a group in demo project

3. switch back to admin user and try to list groups with
a) all-tenants 0
b) all-tenants 1

Expected:
a) should show no records
b) should show the group in demo project

Actual
both a) and b) show the group in demo project

CASE A)

Project ID: f8160c32d28845b0ac0790eb26d38d93
all_tenants=0

REQUEST:

DEBUG:keystoneauth:REQ: curl -g -i -X GET http://127.0.0.1/volume/v3/f8160c32d28845b0ac0790eb26d38d93/groups/detail?all_tenants=0 -H "Accept: application/json" -H "OpenStack-API-Version: volume 3.70" -H "User-Agent: python-cinderclient" -H "X-Auth-Token: {SHA256}2e65100ecc61854a6215e32bc096e26ff2aabf9adfda8eb4993fd2af5e65b170"

RESPONSE:

DEBUG:keystoneauth:RESP BODY: {"groups": [{"id": "26f88c24-c0a7-483c-bc22-89e16317ec18", "status": "available", "availability_zone": "nova", "created_at": "2023-09-04T19:56:27.000000", "name": null, "description": null, "group_type": "3922f568-cce8-49ec-ac27-6eed524a10ef", "volume_types": ["bcb442f1-c6ea-44ea-bc87-f29d9a872361"], "group_snapshot_id": null, "source_group_id": null, "replication_status": "disabled", "project_id": "30be42879abd4d7ead332221266a77bf"}]}

+--------------------------------------+-----------+------+
| ID | Status | Name |
+--------------------------------------+-----------+------+
| 26f88c24-c0a7-483c-bc22-89e16317ec18 | available | - |
+--------------------------------------+-----------+------+

project ID of group: 30be42879abd4d7ead332221266a77bf

CASE B)

Project ID: f8160c32d28845b0ac0790eb26d38d93
all_tenants=1

REQUEST:

DEBUG:keystoneauth:REQ: curl -g -i -X GET http://127.0.0.1/volume/v3/f8160c32d28845b0ac0790eb26d38d93/groups/detail?all_tenants=1 -H "Accept: application/json" -H "OpenStack-API-Version: volume 3.70" -H "User-Agent: python-cinderclient" -H "X-Auth-Token: {SHA256}2d7f7fe743f2333f5981db48cd1fb6f33ad687dcfd6177245ba23f1f4afe75fe"

RESPONSE:

DEBUG:keystoneauth:RESP BODY: {"groups": [{"id": "26f88c24-c0a7-483c-bc22-89e16317ec18", "status": "available", "availability_zone": "nova", "created_at": "2023-09-04T19:56:27.000000", "name": null, "description": null, "group_type": "3922f568-cce8-49ec-ac27-6eed524a10ef", "volume_types": ["bcb442f1-c6ea-44ea-bc87-f29d9a872361"], "group_snapshot_id": null, "source_group_id": null, "replication_status": "disabled", "project_id": "30be42879abd4d7ead332221266a77bf"}]}

project ID of group: 30be42879abd4d7ead332221266a77bf

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/893729

Changed in cinder:
status: New → In Progress
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.