Glance v2 index does not support 'admin_as_user' parameter
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Incomplete
|
Wishlist
|
whhw |
Bug Description
When admin user list images, we add admin_as_user=False to query images that are owned by the user, shared to the user and other public images, instead of list all the images.
But if I add this to v2 command like:
curl -i -X GET -H 'X-Auth-
the result will always be empty, like:
{"images": [], "schema": "/v2/schemas/
It is because the index of v2 implementation does not accept 'admin_as_user', instead all the other parameters that are not present will be passed into 'filters'.
[glance/
def index(self, req, marker=None, limit=None, sort_key=
A simple method to fix is, add this code to image_get_all(), so we can get it from the filters before querying database.
[glance/
def image_get_
......
# added
if 'admin_as_user' in filters:
admin_as_user = filters.
admin_as_user = (admin_
Changed in glance: | |
assignee: | nobody → whhw (wanghuan2) |
description: | updated |
summary: |
- Glance v2 index dose not support 'admin_as_user' parameter + Glance v2 index does not support 'admin_as_user' parameter |
whhw, please don't work on this until we can confirm that this is something that is desired for v2 of the API.