Description of problem:
If after attaching network to Host NIC with Network label feature, you change the Network label on the Network to non-existent label, the network doesn't get removed from the Host NIC and it should
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
1. Create label lb_1 on Host NIC
2. Create label lb_1 on new network
3. Check the network is attached to the Host NIC with the same label
4. Change network label on the network to lb_2 (new label)
Actual results:
Network is still attached to the Host NIC
Expected results:
Network should be removed from Host NIC as there is no label lb_2 on Host NIC
Additional info:
This action should be blocked by UpdateNetworkCommand.canDoAction() and specifically the bug resides in:
UpdateNetworkValidator.notRenamingLabel(String oldLabel):
1. the parameter name should be newLabel
2. the check inside the loop should be changed to:
if (NetworkUtils.isLabeled(nic) && nic.getLabels().contains(network.getLabel()))
Verified on- oVirt Engine Version: 3.5.0-0.0.master.20140715172116.git4687dc1.el6
The action will be blocked with the next error:
"Error while executing action: Cannot edit Network. Renaming a network label while configured on hosts interfaces is not supported. Please unlabel the network first and later specify the new one."