member-id should contian only numbers and letters

Bug #1574991 reported by wangxiyuan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
New
Undecided
Unassigned

Bug Description

Now, there is no limit for member-id's format. It means that all characters are allowed. But member_id means a project's(tenant's) id. It shoud contian only numbers and letters. If not, it will lead some error:

reprodue:
env: glance master

1.create a member for an image:
$glance member-create b9125ded-d2d0-4d4e-9eee-5623344c9cbf fdsae#$%^^da

2.delete the member from the image:
$glance member-delete b9125ded-d2d0-4d4e-9eee-5623344c9cbf fdsae#$%^^da

the error accoured:
404 Not Found
fdsae not found in the member list of the image b9125ded-d2d0-4d4e-9eee-5623344c9cbf.
    (HTTP 404)

wangxiyuan (wangxiyuan)
Changed in glance:
assignee: nobody → wangxiyuan (wangxiyuan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
status: New → In Progress
wangxiyuan (wangxiyuan)
affects: glance → python-glanceclient
wangxiyuan (wangxiyuan)
Changed in python-glanceclient:
assignee: wangxiyuan (wangxiyuan) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-glanceclient (master)

Change abandoned by wangxiyuan (<email address hidden>) on branch: master
Review: https://review.openstack.org/348148

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

You could always quote the member id:
$ glance member-list --image-id 726a66c5-70fd-456e-b6e9-278a83b47918
+--------------------------------------+--------------+---------+
| Image ID | Member ID | Status |
+--------------------------------------+--------------+---------+
| 726a66c5-70fd-456e-b6e9-278a83b47918 | fdsae#$%^^da | pending |
+--------------------------------------+--------------+---------+
$ glance member-delete 726a66c5-70fd-456e-b6e9-278a83b47918 fdsae%23%24%25%5E%5Eda
$ glance member-list --image-id 726a66c5-70fd-456e-b6e9-278a83b47918
+----------+-----------+--------+
| Image ID | Member ID | Status |
+----------+-----------+--------+
+----------+-----------+--------+

The OpenStack Client does not allow a "bad" ID to be used:

$ openstack image add project 726a66c5-70fd-456e-b6e9-278a83b47918 fake-tenant-id
No project with a name or ID of 'fake-tenant-id' exists.

The problem with that is that if a project is deleted, then its membership cannot be removed from an image.

The question is: should the Glance Client check the validity of project IDs or should we trust the user?

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