1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Revert "B #5095: Custom NIC attributes overrides VNET (#282)"

This reverts commit 353ac3863d03f2c6357cbcf3987ddcc82c0b5d4d.
This commit is contained in:
Ruben S. Montero 2020-10-08 18:58:42 +02:00
parent 353ac3863d
commit 2d985fb581
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
4 changed files with 12 additions and 17 deletions

View File

@ -854,8 +854,6 @@ VM_RESTRICTED_ATTR = "NIC/MAC"
VM_RESTRICTED_ATTR = "NIC/VLAN_ID"
VM_RESTRICTED_ATTR = "NIC/BRIDGE"
VM_RESTRICTED_ATTR = "NIC/FILTER"
VM_RESTRICTED_ATTR = "NIC/FILTER_IP_SPOOFING"
VM_RESTRICTED_ATTR = "NIC/FILTER_MAC_SPOOFING"
VM_RESTRICTED_ATTR = "NIC/INBOUND_AVG_BW"
VM_RESTRICTED_ATTR = "NIC/INBOUND_PEAK_BW"
VM_RESTRICTED_ATTR = "NIC/INBOUND_PEAK_KB"

View File

@ -658,10 +658,9 @@ void Image::disk_attribute(VirtualMachineDisk * disk,
for (it = inherit_attrs.begin(); it != inherit_attrs.end(); it++)
{
string current_val = disk->vector_value(*it);
get_template_attribute(*it, inherit_val);
if (current_val.empty() && !inherit_val.empty())
if (!inherit_val.empty())
{
disk->replace(*it, inherit_val);
}

View File

@ -1266,10 +1266,9 @@ void AddressRange::set_vnet(VectorAttribute *nic, const vector<string> &inherit)
for (it = inherit.begin(); it != inherit.end(); it++)
{
string current_val = nic->vector_value(*it);
string inherit_val = attr->vector_value(*it);
if (current_val.empty() && !inherit_val.empty())
if (!inherit_val.empty())
{
nic->replace((*it).c_str(), inherit_val);
}

View File

@ -850,6 +850,16 @@ int VirtualNetwork::nic_attribute(
nic->replace("BRIDGE_TYPE", bridge_type);
}
for (it = inherit_attrs.begin(); it != inherit_attrs.end(); it++)
{
PoolObjectSQL::get_template_attribute(*it, inherit_val);
if (!inherit_val.empty())
{
nic->replace(*it, inherit_val);
}
}
//--------------------------------------------------------------------------
// Get the lease from the Virtual Network
//--------------------------------------------------------------------------
@ -889,17 +899,6 @@ int VirtualNetwork::nic_attribute(
inherit_attrs);
}
for (it = inherit_attrs.begin(); it != inherit_attrs.end(); it++)
{
string current_val = nic->vector_value(*it);
PoolObjectSQL::get_template_attribute(*it, inherit_val);
if (current_val.empty() && !inherit_val.empty())
{
nic->replace(*it, inherit_val);
}
}
//--------------------------------------------------------------------------
// Copy the security group IDs
//--------------------------------------------------------------------------