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

feature #200: Finising the Virtual Network publish functionality

This commit is contained in:
Tino Vázquez 2010-06-30 18:02:59 +02:00
parent ed48b53497
commit ac3b37767f
2 changed files with 12 additions and 11 deletions

View File

@ -254,11 +254,23 @@ int VirtualNetwork::insert(SqlDB * db)
{
ostringstream ose;
int rc;
string public_attr;
if ( vn_template.id == -1 )
{
vn_template.id = oid;
}
// ------------ PUBLIC --------------------
get_template_attribute("PUBLIC", public_attr);
transform (public_attr.begin(), public_attr.end(), public_attr.begin(),
(int(*)(int))toupper);
public_vnet = (public_attr == "YES");
vn_template.erase("PUBLIC");
// Insert the template first
rc = vn_template.insert(db);

View File

@ -72,7 +72,6 @@ int VirtualNetworkPool::allocate (
string name;
string bridge;
string public_attr;
string s_type;
@ -122,16 +121,6 @@ int VirtualNetworkPool::allocate (
vn->get_template_attribute("BRIDGE",bridge);
vn->bridge = bridge;
// ------------ PUBLIC --------------------
vn->get_template_attribute("PUBLIC", public_attr);
transform (public_attr.begin(), public_attr.end(), public_attr.begin(),
(int(*)(int))toupper);
vn->public_vnet = (public_attr == "YES");
vn->vn_template.erase("PUBLIC");
// Insert the VN in the pool so we have a valid OID
*oid = PoolSQL::allocate(vn);