1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-25 23:21:29 +03:00

Bug #1111: Improve constraints when creating a ranged virtual network.

This commit is contained in:
Hector Sanjuan 2012-02-07 18:25:42 +01:00
parent 7f485ad179
commit 22b888e2eb

View File

@ -822,8 +822,8 @@ function setupCreateVNetDialog() {
var ip_start = $('#ip_start',this).val();
var ip_end = $('#ip_end',this).val();
if (!network_addr.length){
notifyError(tr("Please provide a network address"));
if (!(ip_start.length && ip_end.length) && !network_addr.length){
notifyError(tr("There are missing network parameters"));
return false;
};
@ -832,11 +832,15 @@ function setupCreateVNetDialog() {
"vnet" : {
"type" : "RANGED",
"bridge" : bridge,
"network_mask" : network_mask,
"network_address" : network_addr,
"name" : name }
};
if (network_addr.length)
network_json["vnet"]["network_address"]=network_addr;
if (network_mask.length)
network_json["vnet"]["network_mask"]=network_mask;
if (custom){
if (ip_start.length)
network_json["vnet"]["ip_start"] = ip_start;