Przeglądaj źródła

AMBARI-9978. Installer Step 3: User is blocked on step 3 due to js error, back and next buttons disabled (alexantonenko)

Alex Antonenko 10 lat temu
rodzic
commit
7f0ef185c5

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

@@ -1005,9 +1005,10 @@ App.WizardStep3Controller = Em.Controller.extend({
       if (data.Requests.inputs.indexOf("last_agent_env_check") != -1) {
       if (data.Requests.inputs.indexOf("last_agent_env_check") != -1) {
         this.set('stopChecking', true);
         this.set('stopChecking', true);
         this.set('hostsPackagesData', data.tasks.map(function (task) {
         this.set('hostsPackagesData', data.tasks.map(function (task) {
+          var installed_packages = Em.get(task, 'Tasks.structured_out.installed_packages');
           return {
           return {
             hostName: Em.get(task, 'Tasks.host_name'),
             hostName: Em.get(task, 'Tasks.host_name'),
-            installedPackages: Em.get(task, 'Tasks.structured_out.installed_packages')
+            installedPackages: installed_packages ? installed_packages : []
           }
           }
         }));
         }));
         this.getHostInfo();
         this.getHostInfo();
@@ -1479,9 +1480,9 @@ App.WizardStep3Controller = Em.Controller.extend({
       }, this);
       }, this);
 
 
       //parse all package warnings for host
       //parse all package warnings for host
-      var hostPackagesData = hostsPackagesData.findProperty('hostName', _host.Hosts.host_name);
-      if (hostPackagesData) {
-        hostPackagesData.installedPackages.forEach(function (_package) {
+      var _hostPackagesData = hostsPackagesData.findProperty('hostName', _host.Hosts.host_name);
+      if (_hostPackagesData) {
+        _hostPackagesData.installedPackages.forEach(function (_package) {
           warning = warningCategories.packagesWarnings[_package.name];
           warning = warningCategories.packagesWarnings[_package.name];
           if (warning) {
           if (warning) {
             warning.hosts.push(_host.Hosts.host_name);
             warning.hosts.push(_host.Hosts.host_name);