Merge pull request #2784 from jlmitch5/fixClusterLicenseInfo

use post response if config get request erroneously doesnt have licen…
This commit is contained in:
John Mitchell 2018-08-08 10:38:36 -04:00 committed by GitHub
commit dc9f3b2b51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -98,11 +98,11 @@ export default
$scope.submit = function() {
Wait('start');
CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula)
.then(() => {
.then((licenseInfo) => {
reset();
ConfigService.delete();
ConfigService.getConfig()
ConfigService.getConfig(licenseInfo)
.then(function(config) {
delete($rootScope.features);
FeaturesService.get();

View File

@ -21,7 +21,7 @@ export default
delete(this.config);
},
getConfig: function () {
getConfig: function (licenseInfo) {
var config = this.get(),
that = this,
deferred = $q.defer();
@ -31,6 +31,11 @@ export default
Wait('start');
var promise = Rest.get();
promise.then(function (response) {
// if applicable, use the license POSTs response if the config GET request is not returned due to a
// cluster cache update race condition
if (_.isEmpty(response.data.license_info) && !_.isEmpty(licenseInfo)) {
response.data.license_info = licenseInfo;
}
var config = response.data;
$rootScope.configReady = true;
Wait('stop');