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

feature #3789: Reference Network used by a NIC in context

This commit is contained in:
Ruben S. Montero 2015-05-07 12:04:35 +02:00
parent 7e26c511ab
commit 4b66f92b08
3 changed files with 5 additions and 4 deletions

View File

@ -787,7 +787,6 @@ error_cleanup:
static void parse_context_network(const char* vars[][2], int num_vars,
VectorAttribute * context, VectorAttribute * nic)
{
string name = nic->vector_value("NETWORK");
string nic_id = nic->vector_value("NIC_ID");
for (int i=0; i < num_vars; i++)
@ -810,7 +809,7 @@ static void parse_context_network(const char* vars[][2], int num_vars,
{
ostringstream cval_ss;
cval_ss << "$NETWORK["<< vars[i][1] <<", NETWORK=\""<< name <<"\"]";
cval_ss << "$NETWORK["<< vars[i][1] <<", NIC_ID=\""<< nic_id <<"\"]";
cval = cval_ss.str();
}

View File

@ -231,7 +231,8 @@ void get_network_attribute(VirtualMachine * vm,
attr_value.clear();
if ( net_name.empty() || (net_name!="NETWORK" && net_name!="NETWORK_ID") )
if ( net_name.empty() ||
(net_name!="NETWORK" && net_name!="NETWORK_ID" && net_name!="NIC_ID"))
{
return;
}

View File

@ -176,7 +176,8 @@ void get_network_attribute(VirtualMachine * vm,
attr_value.clear();
if ( net_name.empty() || (net_name!="NETWORK" && net_name!="NETWORK_ID") )
if ( net_name.empty() ||
(net_name!="NETWORK" && net_name!="NETWORK_ID" && net_name!="NIC_ID"))
{
return;
}