mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -03:30
use post response if config get request erroneously doesnt have license_info
This commit is contained in:
@@ -98,11 +98,11 @@ export default
|
|||||||
$scope.submit = function() {
|
$scope.submit = function() {
|
||||||
Wait('start');
|
Wait('start');
|
||||||
CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula)
|
CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula)
|
||||||
.then(() => {
|
.then((licenseInfo) => {
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
ConfigService.delete();
|
ConfigService.delete();
|
||||||
ConfigService.getConfig()
|
ConfigService.getConfig(licenseInfo)
|
||||||
.then(function(config) {
|
.then(function(config) {
|
||||||
delete($rootScope.features);
|
delete($rootScope.features);
|
||||||
FeaturesService.get();
|
FeaturesService.get();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default
|
|||||||
delete(this.config);
|
delete(this.config);
|
||||||
},
|
},
|
||||||
|
|
||||||
getConfig: function () {
|
getConfig: function (licenseInfo) {
|
||||||
var config = this.get(),
|
var config = this.get(),
|
||||||
that = this,
|
that = this,
|
||||||
deferred = $q.defer();
|
deferred = $q.defer();
|
||||||
@@ -31,6 +31,11 @@ export default
|
|||||||
Wait('start');
|
Wait('start');
|
||||||
var promise = Rest.get();
|
var promise = Rest.get();
|
||||||
promise.then(function (response) {
|
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;
|
var config = response.data;
|
||||||
$rootScope.configReady = true;
|
$rootScope.configReady = true;
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
|
|||||||
Reference in New Issue
Block a user