فهرست منبع

AMBARI-12580. Host Check changes: use THP data from custom action response and call custom action for package and other checks during "Rerun check" (alexantonenko)

Alex Antonenko 10 سال پیش
والد
کامیت
1d524a7f24
2فایلهای تغییر یافته به همراه14 افزوده شده و 5 حذف شده
  1. 13 4
      ambari-web/app/controllers/wizard/step3_controller.js
  2. 1 1
      ambari-web/test/controllers/wizard/step3_test.js

+ 13 - 4
ambari-web/app/controllers/wizard/step3_controller.js

@@ -271,7 +271,7 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
     var isHostsLoaded = this.get('hosts').length !== 0;
     var isPrevAndCurrStepsSetted = previousStep && currentStep;
     var isPrevStepSmallerThenCurrent = previousStep < currentStep;
-    if (!isHostsLoaded || isPrevStepSmallerThenCurrent || 
+    if (!isHostsLoaded || isPrevStepSmallerThenCurrent ||
         !wizardController || !isPrevAndCurrStepsSetted) {
       this.disablePreviousSteps();
       this.clearStep();
@@ -913,7 +913,7 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
     if (App.get('testMode')) {
       this.getHostInfo();
     } else {
-      var data = this.getDataForCheckRequest("last_agent_env_check,installed_packages,existing_repos", false);
+      var data = this.getDataForCheckRequest("last_agent_env_check,installed_packages,existing_repos,transparentHugePage", false);
       data ? this.requestToPerformHostCheck(data) : this.stopHostCheck();
     }
   },
@@ -1044,8 +1044,9 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
           var installed_packages = Em.get(task, 'Tasks.structured_out.installed_packages');
           return {
             hostName: Em.get(task, 'Tasks.host_name'),
+            transparentHugePage: Em.get(task, 'Tasks.structured_out.transparentHugePage.message'),
             installedPackages: installed_packages ? installed_packages : []
-          }
+          };
         }));
         this.getHostInfo();
       } else if (data.Requests.inputs.indexOf("host_resolution_check") != -1) {
@@ -1145,7 +1146,13 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
             hostsDiskNames.push(host_name);
           }
           // "Transparent Huge Pages" check
-          context = self.checkTHP(host_name, Em.get(host, 'Hosts.last_agent_env.transparentHugePage'));
+          var _hostPackagesData = self.get('hostsPackagesData').findProperty('hostName', host.Hosts.host_name);
+          if (_hostPackagesData) {
+            var transparentHugePage = _hostPackagesData.transparentHugePage;
+            context = self.checkTHP(host_name, transparentHugePage);
+          } else {
+            context = self.checkTHP(host_name, Em.get(host, 'Hosts.last_agent_env.transparentHugePage'));
+          }
           if (context) {
             thpContext.push(context);
             thpHostsNames.push(host_name);
@@ -1378,6 +1385,7 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
     var self = this;
     var currentProgress = 0;
     this.getHostNameResolution();
+    this.getGeneralHostCheck();
     this.checkHostJDK();
     var interval = setInterval(function () {
       currentProgress += 100000 / self.get('warningsTimeInterval');
@@ -1494,6 +1502,7 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
 
       //parse all package warnings for host
       var _hostPackagesData = hostsPackagesData.findProperty('hostName', _host.Hosts.host_name);
+
       if (_hostPackagesData) {
         _hostPackagesData.installedPackages.forEach(function (_package) {
           warning = warningCategories.packagesWarnings[_package.name];

+ 1 - 1
ambari-web/test/controllers/wizard/step3_test.js

@@ -2495,7 +2495,7 @@ describe('App.WizardStep3Controller', function () {
       c.getHostCheckTasksSuccess(lastAgentEnvCheckComplete);
       expect(c.get('stopChecking')).to.be.true;
       expect(c.getHostInfo.calledOnce).to.be.true;
-      expect(c.get('hostsPackagesData')).eql([
+      expect(JSON.parse(JSON.stringify(c.get('hostsPackagesData')))).eql([
         {
           hostName: 'h1',
           installedPackages: [