mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-28 14:50:08 +03:00
M #-: fix bug when attach alias fails (#322)
This commit is contained in:
parent
0c85e1eb27
commit
2879ebe17a
@ -965,7 +965,7 @@ void VirtualMachinePool::delete_attach_disk(int vid)
|
||||
void VirtualMachinePool::delete_attach_nic(int vid)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
VirtualMachineNic * nic;
|
||||
VirtualMachineNic * nic, * p_nic;
|
||||
|
||||
int uid;
|
||||
int gid;
|
||||
@ -1009,6 +1009,18 @@ void VirtualMachinePool::delete_attach_nic(int vid)
|
||||
nic->vector_value("ALIAS_ID", alias_id);
|
||||
|
||||
vm->clear_nic_alias_context(parent_id, alias_id);
|
||||
|
||||
p_nic = vm->get_nic(parent_id);
|
||||
|
||||
// As NIC is an alias, parent ALIAS_IDS array should be updated
|
||||
// to remove the alias_id
|
||||
std::set<int> p_a_ids;
|
||||
|
||||
one_util::split_unique(p_nic->vector_value("ALIAS_IDS"), ',', p_a_ids);
|
||||
|
||||
p_a_ids.erase(nic_id);
|
||||
|
||||
p_nic->replace("ALIAS_IDS", one_util::join(p_a_ids, ','));
|
||||
}
|
||||
|
||||
uid = vm->get_uid();
|
||||
|
Loading…
x
Reference in New Issue
Block a user