Feature #4215: Reverse NETWORK and NETWORK_ID priority in auth

For consistency with commit:7410c78
This commit is contained in:
Carlos Martín committed 2016-02-01 17:03:30 +01:00
1 parent cfdfacf259
commit da39b2f424
2 files changed
+15 -15

No files matched your search

+10 -10
View File
@@ -494,16 +494,7 @@ void ImagePool::disk_attribute(
Nebula& nd = Nebula::instance();
DatastorePool * ds_pool = nd.get_dspool();
if (!(source = disk->vector_value("IMAGE")).empty())
{
int uiid = get_disk_uid(disk,uid);
if ( uiid != -1)
{
img = get(source, uiid, true);
}
}
else if (!(source = disk->vector_value("IMAGE_ID")).empty())
if (!(source = disk->vector_value("IMAGE_ID")).empty())
{
int iid = get_disk_id(source);
@@ -512,6 +503,15 @@ void ImagePool::disk_attribute(
img = get(iid, true);
}
}
else if (!(source = disk->vector_value("IMAGE")).empty())
{
int uiid = get_disk_uid(disk,uid);
if ( uiid != -1)
{
img = get(source, uiid, true);
}
}
if ( img != 0 )
{
+5 -5
View File
@@ -310,7 +310,11 @@ void VirtualNetworkPool::authorize_nic(VectorAttribute * nic,
PoolObjectAuth perm;
string error;
if (!(network = nic->vector_value("NETWORK")).empty())
if (!(network = nic->vector_value("NETWORK_ID")).empty())
{
vnet = get_nic_by_id(network, error);
}
else if (!(network = nic->vector_value("NETWORK")).empty())
{
vnet = get_nic_by_name (nic, network, uid, error);
@@ -319,10 +323,6 @@ void VirtualNetworkPool::authorize_nic(VectorAttribute * nic,
nic->replace("NETWORK_ID", vnet->get_oid());
}
}
else if (!(network = nic->vector_value("NETWORK_ID")).empty())
{
vnet = get_nic_by_id(network, error);
}
else //Not using a pre-defined network
{
return;