Nova remove-fixed-ip doesn't return an error message when incorrect fixed IP is removed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Reproduce steps:
1. Create net01: net01__subnet, 192.168.1.0/24:
neutron net-create net01
neutron subnet-create net01 192.168.1.0/24 --enable-dhcp --name net01__subnet
2. Boot instance vm1 in net01:
NET_ID=$(neutron net-list | grep 'net01' | awk '{print $2}')
nova boot --flavor m1.micro --image TestVM --nic net-id=$NET_ID --security-groups default vm1
3. Note the fixed IP of vm1:
nova show vm1 | grep network
| net01 network | 192.168.1.36 |
4. Try to remove incorrect fixed IP from vm1:
nova remove-fixed-ip vm1 192.168.1.37
Expected result:
A message appears informing that the operation was not correct
Actual result:
Nothing happens and displayed
Nova version - http://
tags: | added: network |
tags: | added: neutron |
Changed in nova: | |
assignee: | nobody → Zhihai Song (szhsong) |
Changed in nova: | |
assignee: | nobody → Pushkar Umaranikar (pushkar-umaranikar) |
tags: | added: api |
Changed in nova: | |
assignee: | Pushkar Umaranikar (pushkar-umaranikar) → nobody |
I confirmed that the remove_ fixed_ip_ from_instance method in nova/network/ neutronv2/ api.py throws a fairly generic exception when an error is encountered. Improving the exception information could improve user experience. Additionally I audited the unit test coverage for this method and found exception states are not directly tested (eg, what happens when an invalid IP is provided as the argument to this particular method). I would suggest the fix for this bug is 2 parts, 1) improve exception information for remove_ fixed_ip_ from_instance and 2) improve unit test coverage for error states.