mirror of https://github.com/apache/cloudstack.git
ui: do not send conserve mode on L2 network offering creation from the UI (#2694)
Do not send conserve mode param on L2 network offering creation from the UI. Fix config drive NPE issue on L2 network.
This commit is contained in:
parent
3af54ec1a8
commit
99ca81a676
|
|
@ -286,7 +286,7 @@ public class ConfigDriveBuilder {
|
||||||
if (!NetworkModel.METATDATA_DIR.equals(dataType)) {
|
if (!NetworkModel.METATDATA_DIR.equals(dataType)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(content)) {
|
if (StringUtils.isEmpty(content)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//keys are a special case in OpenStack format
|
//keys are a special case in OpenStack format
|
||||||
|
|
|
||||||
|
|
@ -2412,14 +2412,17 @@
|
||||||
if ($useVpcCb.is(':checked')) { //if useVpc is checked,
|
if ($useVpcCb.is(':checked')) { //if useVpc is checked,
|
||||||
$useVpcCb.removeAttr("checked"); //remove "checked" attribute in useVpc
|
$useVpcCb.removeAttr("checked"); //remove "checked" attribute in useVpc
|
||||||
}
|
}
|
||||||
|
$conservemode.css('display', 'inline-block');
|
||||||
} else if ($guestTypeField.val() == 'Isolated') { //Isolated network offering
|
} else if ($guestTypeField.val() == 'Isolated') { //Isolated network offering
|
||||||
$useVpc.css('display', 'inline-block');
|
$useVpc.css('display', 'inline-block');
|
||||||
$supportedServices.css('display', 'inline-block');
|
$supportedServices.css('display', 'inline-block');
|
||||||
$userDataL2.hide();
|
$userDataL2.hide();
|
||||||
|
$conservemode.css('display', 'inline-block');
|
||||||
} else if ($guestTypeField.val() == 'L2') {
|
} else if ($guestTypeField.val() == 'L2') {
|
||||||
$useVpc.hide();
|
$useVpc.hide();
|
||||||
$supportedServices.hide();
|
$supportedServices.hide();
|
||||||
$userDataL2.css('display', 'inline-block');
|
$userDataL2.css('display', 'inline-block');
|
||||||
|
$conservemode.hide();
|
||||||
}
|
}
|
||||||
var $providers = $useVpcCb.closest('form').find('.dynamic-input select[name!="service.Connectivity.provider"]');
|
var $providers = $useVpcCb.closest('form').find('.dynamic-input select[name!="service.Connectivity.provider"]');
|
||||||
var $optionsOfProviders = $providers.find('option');
|
var $optionsOfProviders = $providers.find('option');
|
||||||
|
|
@ -3403,6 +3406,9 @@
|
||||||
} else {
|
} else {
|
||||||
delete inputData.serviceProviderList;
|
delete inputData.serviceProviderList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Conserve mode is irrelevant on L2 network offerings as there are no resources to conserve, do not pass it, true by default on server side
|
||||||
|
delete inputData.conservemode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputData['forvpc'] == 'on') {
|
if (inputData['forvpc'] == 'on') {
|
||||||
|
|
@ -3411,10 +3417,12 @@
|
||||||
delete inputData.forvpc; //if forVpc checkbox is unchecked, do not pass forVpc parameter to API call since we need to keep API call's size as small as possible (p.s. forVpc is defaulted as false at server-side)
|
delete inputData.forvpc; //if forVpc checkbox is unchecked, do not pass forVpc parameter to API call since we need to keep API call's size as small as possible (p.s. forVpc is defaulted as false at server-side)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputData['conservemode'] == 'on') {
|
if (inputData['guestIpType'] == "Shared" || inputData['guestIpType'] == "Isolated") {
|
||||||
delete inputData.conservemode; //if ConserveMode checkbox is checked, do not pass conservemode parameter to API call since we need to keep API call's size as small as possible (p.s. conservemode is defaulted as true at server-side)
|
if (inputData['conservemode'] == 'on') {
|
||||||
} else {
|
delete inputData.conservemode; //if ConserveMode checkbox is checked, do not pass conservemode parameter to API call since we need to keep API call's size as small as possible (p.s. conservemode is defaulted as true at server-side)
|
||||||
inputData['conservemode'] = false;
|
} else {
|
||||||
|
inputData['conservemode'] = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make service provider map
|
// Make service provider map
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue