Able to show update and delete aggregate with invalid id
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Johannes Kulik | ||
Pike |
New
|
Undecided
|
Unassigned | ||
Queens |
New
|
Undecided
|
Unassigned | ||
Rocky |
New
|
Undecided
|
Unassigned | ||
Stein |
Fix Released
|
Undecided
|
Unassigned | ||
Train |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Description
===========
Able to show, update and delete the aggregate with invalid id. Invalid id means it will start with the same id but appended with some alphanumeric string(ex - actual_id: 5 invalid_id: 5abcd or invalid_id: 5abcd123).
This issue is only with actual_id appended with alphanumeric value started with alphabets not with numbers.
The aggregate id which is being received on routes is not converting to integer anywhere in the code and later it gets transfer to db , which truncates the appended string with original id -
ex below warning -
/usr/local/
There are ways to change the setting and convert the warning into error but the code should handle such situation and raise an exception with proper error message.
Steps to reproduce
==================
1. Create an aggregate -
+----+-
| ID | Name | Availability Zone |
+----+-
| 5 | new_name | None |
+----+-
2. Get the above created aggregate with a wrong id Ex - 5abcd (started with correct id but appended with some alphabets)
curl -g -i -X GET http://
Content-Length: 226
Content-Type: application/json
Openstack-
X-Openstack-
Vary: OpenStack-
Vary: X-OpenStack-
X-Compute-
Date: Thu, 27 Feb 2020 13:44:07 GMT
{"aggregate": {"name": "new_name", "availability_
3. Update the above created aggregate with a wrong id Ex - 5abcd (started with correct id but appended with some alphabets) -
Response (0.169s) - http://
200 OK
{
"aggregate": {
"name": "new_updated",
"availabili
"deleted": false,
"created_at": "2020-02-
"updated_at": "2020-02-
"hosts": [],
"deleted_at": null,
"id": 5,
"metadata": {}
}
}
4. Delete the above created aggregate with a wrong id Ex - 5abcd (started with correct id but appended with some alphabets) -
curl -g -i -X DELETE http://
HTTP/1.1 200 OK
Content-Length: 0
Content-Type: application/json
Openstack-
X-Openstack-
Vary: OpenStack-
Vary: X-OpenStack-
X-Compute-
Date: Thu, 27 Feb 2020 13:46:10 GMT
Expected result
===============
Show, update and delete should not work for invalid id (mentioned in summary).
Actual result
=============
Show, update and delete is working for invalid id (mentioned in summary).
Environment
===========
1. Openstack Release - Ocata
2. Hypervisor - QEMU
Changed in nova: | |
assignee: | GEET JAIN (geet123jain) → Johannes Kulik (jkulik) |
Will be trying to fix this.