feature #2858: Do not allow to reserve on the same VNET

This commit is contained in:
Ruben S. Montero committed 2014-06-06 12:14:26 +02:00
1 parent 5890beb255
commit 07ca23fcde
1 file changed
+13 -4
+13 -4
View File
@@ -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;