New flavor name may be the same as existent flavor id
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-openstackclient |
Invalid
|
Undecided
|
Unassigned |
Bug Description
(openstack) flavor list
+----+-
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-
| 1 | m1.tiny | 512 | 1 | 0 | 1 | True |
| 2 | m1.small | 2048 | 20 | 0 | 1 | True |
| 3 | m1.medium | 4096 | 40 | 0 | 2 | True |
| 4 | m1.large | 8192 | 80 | 0 | 4 | True |
| 42 | m1.nano | 64 | 0 | 0 | 1 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | 8 | True |
| 84 | m1.micro | 128 | 0 | 0 | 1 | True |
| c1 | cirros256 | 256 | 0 | 0 | 1 | True |
| d1 | ds512M | 512 | 5 | 0 | 1 | True |
| d2 | ds1G | 1024 | 10 | 0 | 1 | True |
| d3 | ds2G | 2048 | 10 | 0 | 2 | True |
| d4 | ds4G | 4096 | 20 | 0 | 4 | True |
+----+-
The flavor list shows that the ID of existent flavor is particular because it is not a uuid but a string.(Such as "1","2"
We know flavor name is a string too,so if we create a new flavor,the new flavor name may be the same as the existent flavor id.
for example:
(openstack) flavor create 1
+------
| Field | Value |
+------
| OS-FLV-
| OS-FLV-
| disk | 0 |
| id | ccda0d67-
| name | 1 |
| os-flavor-
| ram | 256 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+------
I create a new flavor named "1" which is the same as a existent flavor ID "1".
Then I want to show this new flavor.
(openstack) flavor show 1
+------
| Field | Value |
+------
| OS-FLV-
| OS-FLV-
| disk | 1 |
| id | 1 |
| name | m1.tiny |
| os-flavor-
| properties | |
| ram | 512 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+------
We can see,we showed not the new flavor but a flavor which id is "1",the reason is that commands always find a flavor by ID at first.
So,I think it is necessary to avoid sameness between new flavor name and existent flavor ID.
Changed in python-openstackclient: | |
assignee: | nobody → aohuanxuan (huanxuan-ao) |
summary: |
- New flavor name may be the same with existent flavor id + New flavor name may be the same as existent flavor id |
Fix proposed to branch: master /review. openstack. org/319523
Review: https:/