rhtyd closed pull request #2694: Do not send conserve mode param on L2 network
offering creation from the UI
URL: https://github.com/apache/cloudstack/pull/2694
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/engine/storage/configdrive/src/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilder.java
b/engine/storage/configdrive/src/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilder.java
index dc6b8893495..55e7979a772 100644
---
a/engine/storage/configdrive/src/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilder.java
+++
b/engine/storage/configdrive/src/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilder.java
@@ -286,7 +286,7 @@ private static void buildOpenStackMetaData(JsonObject
metaData, String dataType,
if (!NetworkModel.METATDATA_DIR.equals(dataType)) {
return;
}
- if (StringUtils.isNotBlank(content)) {
+ if (StringUtils.isEmpty(content)) {
return;
}
//keys are a special case in OpenStack format
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 2eee7bbeae0..f229d24b19e 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -2412,14 +2412,17 @@
if ($useVpcCb.is(':checked')) {
//if useVpc is checked,
$useVpcCb.removeAttr("checked"); //remove "checked" attribute in useVpc
}
+ $conservemode.css('display',
'inline-block');
} else if ($guestTypeField.val() ==
'Isolated') { //Isolated network offering
$useVpc.css('display',
'inline-block');
$supportedServices.css('display',
'inline-block');
$userDataL2.hide();
+ $conservemode.css('display',
'inline-block');
} else if ($guestTypeField.val() ==
'L2') {
$useVpc.hide();
$supportedServices.hide();
$userDataL2.css('display',
'inline-block');
+ $conservemode.hide();
}
var $providers =
$useVpcCb.closest('form').find('.dynamic-input
select[name!="service.Connectivity.provider"]');
var $optionsOfProviders =
$providers.find('option');
@@ -3403,6 +3406,9 @@
} else {
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') {
@@ -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)
}
- if (inputData['conservemode'] == 'on') {
- 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)
- } else {
- inputData['conservemode'] = false;
+ if (inputData['guestIpType'] == "Shared" ||
inputData['guestIpType'] == "Isolated") {
+ if (inputData['conservemode'] == 'on') {
+ 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)
+ } else {
+ inputData['conservemode'] = false;
+ }
}
// Make service provider map
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services