mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-15 09:13:15 +09:00
feature #2858: Do not allow to reserve on the same VNET
This commit is contained in:
1 parent
5890beb255
commit
07ca23fcde
1 file changed
+13
-4
@@ -226,11 +226,20 @@ void VirtualNetworkReserve::request_execute(
|
||||
int rid;
|
||||
bool on_exisiting = tmpl.get("NETWORK_ID", rid);
|
||||
|
||||
if ( on_exisiting && (rid < 0))
|
||||
if ( on_exisiting)
|
||||
{
|
||||
failure_response(ACTION, request_error("Error in reservation request",
|
||||
"NETWORK_ID must be equal or greater than 0"), att);
|
||||
return;
|
||||
if (rid < 0)
|
||||
{
|
||||
failure_response(ACTION, request_error("Error in reservation request",
|
||||
"NETWORK_ID must be equal or greater than 0"), att);
|
||||
return;
|
||||
}
|
||||
else if (rid == id)
|
||||
{
|
||||
failure_response(ACTION, request_error("Error in reservation request",
|
||||
"Cannot add a reservation from the same network"), att);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
string name;
|
||||
|
||||
Reference in new issue
Block a user