mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-25 02:50:08 +03:00
Default NETWOR_SIZE is now included in the VNET template when used
This commit is contained in:
parent
76ad1887f1
commit
e06ce5e85f
@ -324,16 +324,6 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str)
|
||||
|
||||
vn_template->erase("PUBLIC");
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Insert the Virtual Network
|
||||
//--------------------------------------------------------------------------
|
||||
rc = insert_replace(db, false);
|
||||
|
||||
if ( rc != 0 )
|
||||
{
|
||||
goto error_update;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Get the leases
|
||||
//--------------------------------------------------------------------------
|
||||
@ -370,6 +360,14 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str)
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
SingleAttribute * attribute;
|
||||
ostringstream oss;
|
||||
|
||||
oss << default_size;
|
||||
|
||||
attribute = new SingleAttribute("NETWORK_SIZE",oss.str());
|
||||
vn_template->set(attribute);
|
||||
|
||||
size = default_size;
|
||||
}
|
||||
|
||||
@ -396,6 +394,16 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str)
|
||||
goto error_null_leases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Insert the Virtual Network
|
||||
//--------------------------------------------------------------------------
|
||||
rc = insert_replace(db, false);
|
||||
|
||||
if ( rc != 0 )
|
||||
{
|
||||
goto error_update;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error_type:
|
||||
@ -416,14 +424,11 @@ error_update:
|
||||
|
||||
error_addr:
|
||||
ose << "Network address is not defined, id: ";
|
||||
goto error_leases;
|
||||
goto error_common;
|
||||
|
||||
error_null_leases:
|
||||
ose << "Error getting Virtual Network leases, id: ";
|
||||
|
||||
error_leases:
|
||||
vn_drop(db);
|
||||
|
||||
error_common:
|
||||
ose << oid << ".";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user