strings are being treated as numbers
Bug #1371924 reported by
Alun Champion
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-openstackclient |
Fix Released
|
Undecided
|
wanghong |
Bug Description
The openstack cli is incorrectly handling strings when converting from name, e.g. a user with the name 012345 cannot be directly shown.
openstack> user show 012345
Could not find user, 12345. (HTTP 404)
openstack> user show "012345"
Could not find user, 12345. (HTTP 404)
Looks like it is interpreting it is a number and then converting to a string.
However an ID with a leading 0 works fine.
openstack> user show 00aa8edab211230
Works
Changed in python-openstackclient: | |
assignee: | nobody → wanghong (w-wanghong) |
Changed in python-openstackclient: | |
milestone: | none → m6 |
Changed in python-openstackclient: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
This is because "012345".isdigit() is True and keystoneclient raises HTTPClientError(https:/ /github. com/openstack/ python- keystoneclient/ blob/master/ keystoneclient/ openstack/ common/ apiclient/ exceptions. py#L462) rather than NotFound. So, the code https:/ /github. com/openstack/ python- openstackclient /blob/master/ openstackclient /common/ utils.py# L35 can not catch the excepted exception.