Browse Source

AMBARI-5457 Host Checks: alternatives check results are not surfaced in Host Check popup. (ababiichuk)

aBabiichuk 11 years ago
parent
commit
7db13dd368

+ 31 - 1
ambari-web/app/controllers/wizard/step3_controller.js

@@ -764,7 +764,8 @@ App.WizardStep3Controller = Em.Controller.extend({
       packagesWarnings: {},
       processesWarnings: {},
       servicesWarnings: {},
-      usersWarnings: {}
+      usersWarnings: {},
+      alternativeWarnings: {}
     };
 
     data.items.sortPropertyLight('Hosts.host_name').forEach(function (_host) {
@@ -925,6 +926,25 @@ App.WizardStep3Controller = Em.Controller.extend({
         host.warnings.push(warning);
       }
 
+      if (_host.Hosts.last_agent_env.alternatives) {
+        _host.Hosts.last_agent_env.alternatives.forEach(function (alternative) {
+          warning = warningCategories.alternativeWarnings[alternative.name];
+          if (warning) {
+            warning.hosts.push(_host.Hosts.host_name);
+            warning.onSingleHost = false;
+          } else {
+            warningCategories.alternativeWarnings[alternative.name] = warning = {
+              name: alternative.name,
+              target: alternative.target,
+              hosts: [_host.Hosts.host_name],
+              category: 'alternatives',
+              onSingleHost: false
+            };
+          }
+          host.warnings.push(warning);
+        }, this);
+      }
+
       hosts.push(host);
     }, this);
 
@@ -1170,6 +1190,16 @@ App.WizardStep3Controller = Em.Controller.extend({
               action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
               category: 'misc',
               isCollapsed: true
+            }),
+            Ember.Object.create({
+              warnings: categoryWarnings.filterProperty('category', 'alternatives'),
+              title: Em.I18n.t('installer.step3.hostWarningsPopup.alternatives'),
+              message: Em.I18n.t('installer.step3.hostWarningsPopup.alternatives.message'),
+              type: Em.I18n.t('installer.step3.hostWarningsPopup.alternatives.umask'),
+              emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.alternatives.emptyinstaller.step3.hostWarningsPopup.alternatives.empty'),
+              action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
+              category: 'alternatives',
+              isCollapsed: true
             })
           ]
         }.property('category', 'warningsByHost'),

+ 5 - 0
ambari-web/app/messages.js

@@ -483,6 +483,11 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.misc':'Misc Issues',
   'installer.step3.hostWarningsPopup.misc.message':'The following umasks should be changed',
   'installer.step3.hostWarningsPopup.misc.umask':'Umask',
+  'installer.step3.hostWarningsPopup.alternatives':'Alternatives Issues',
+  'installer.step3.hostWarningsPopup.alternatives.umask' : 'Alternatives',
+  'installer.step3.hostWarningsPopup.alternatives.message':'The following alternatives should be removed',
+  'installer.step3.hostWarningsPopup.alternatives.noIssues':'There was no alternative issue following alternatives should be removed',
+  'installer.step3.hostWarningsPopup.alternatives.empty': 'alternative issues',
   'installer.step3.hostWarningsPopup.issue':'issue',
   'installer.step3.hostWarningsPopup.issues':'issues',
   'installer.step3.hostWarningsPopup.emptyMessage':'There were no',

+ 3 - 0
ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs

@@ -66,6 +66,9 @@
               {{#if warning.version}}
                   <td class="package-version">{{warning.version}}</td>
               {{/if}}
+              {{#if warning.target}}
+                <td class="package-version">{{warning.target}}</td>
+              {{/if}}
               <td>{{category.action}}
                 <a href="javascript:void(null);" rel='HostsListTooltip' {{bindAttr data-original-title="warning.hostsList"}} {{action showHostsPopup warning.hosts}}>
                   {{warning.hosts.length}}