Przeglądaj źródła

AMBARI-6248. hostname resolution failure should also include info on what hostnames did not resolve.(xiwang)

Xi Wang 11 lat temu
rodzic
commit
2798022282

+ 8 - 3
ambari-web/app/controllers/wizard/step3_controller.js

@@ -910,16 +910,21 @@ App.WizardStep3Controller = Em.Controller.extend({
             return;
           }
         }
+        var targetHostName = Em.get(task, "Tasks.host_name");
+        var relatedHostNames = Em.get(task, "Tasks.structured_out.host_resolution_check.failures") ? Em.get(task, "Tasks.structured_out.host_resolution_check.failures").mapProperty('host') : [];
+        var contextMessage = Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.context').format(targetHostName, relatedHostNames.join(', '));
         if (!hostInfo) {
           hostInfo = {
             name: name,
-            hosts: [task.Tasks.host_name],
+            hosts: [contextMessage],
+            hostsNames: [targetHostName],
             onSingleHost: true
           };
           this.get("hostCheckWarnings").push(hostInfo);
         } else {
-          if (!hostInfo.hosts.contains(task.Tasks.host_name)) {
-            hostInfo.hosts.push(task.Tasks.host_name);
+          if (!hostInfo.hostsNames.contains(targetHostName)) {
+            hostInfo.hosts.push(contextMessage);
+            hostInfo.hostsNames.push(targetHostName);
           }
         }
       } else {

+ 2 - 1
ambari-web/app/messages.js

@@ -456,7 +456,7 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.report.jdk': '<br><br>######################################<br># JDK Check <br>#<br># A newline delimited list of JDK issues.<br>######################################<br>JDK ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.disk': '<br><br>######################################<br># Disk <br>#<br># A newline delimited list of disk issues.<br>######################################<br>DISK ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.repositories': '<br><br>######################################<br># Repositories <br>#<br># A newline delimited list of repositories issues.<br>######################################<br>REPOSITORIES ISSUES<br>',
-  'installer.step3.hostWarningsPopup.report.hostNameResolution': '<br><br>######################################<br># Hostname Resolution<br>#<br># A space delimited list of host names on which hostname resolution failed.<br>######################################<br>HOSTNAME RESOLUTION ISSUES<br>',
+  'installer.step3.hostWarningsPopup.report.hostNameResolution': '<br><br>######################################<br># Hostname Resolution<br>#<br># A newline delimited list of hostname resolution issues.<br>######################################<br>HOSTNAME RESOLUTION ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.firewall': '<br><br>######################################<br># Firewall<br>#<br># A newline delimited list of firewall issues.<br>######################################<br>FIREWALL<br>',
   'installer.step3.hostWarningsPopup.report.fileFolders': '<br><br>######################################<br># Files and Folders<br>#<br># A space delimited list of files and folders which should not exist.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br># Example: rm -r /etc/hadoop /etc/hbase<br>######################################<br>FILES AND FOLDERS<br>',
   'installer.step3.hostWarningsPopup.report.reverseLookup': '<br><br>######################################<br># Reverse Lookup<br># <br># The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. <br># Please check the DNS setup and fix the issue.<br>######################################<br>REVERSE LOOKUP<br>',
@@ -527,6 +527,7 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.resolution.validation': 'Hostname resolution validation',
   'installer.step3.hostWarningsPopup.resolution.validation.message': 'Not all hosts could resolve hostnames of other hosts. Make sure that host resolution works properly on all hosts before continuing.',
   'installer.step3.hostWarningsPopup.resolution.validation.empty': 'hostname resolution issues',
+  'installer.step3.hostWarningsPopup.resolution.validation.context': '{0} could not resolve: {1}.',
   'installer.step3.hostWarningsPopup.action.exists':'Exists on',
   'installer.step3.hostWarningsPopup.action.notRunning':'Not running on',
   'installer.step3.hostWarningsPopup.action.installed':'Installed on',

+ 2 - 2
ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js

@@ -317,7 +317,7 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
     }
     if (content.findProperty('category', 'hostNameResolution').warnings.length) {
       newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hostNameResolution');
-      newContent += content.findProperty('category', 'hostNameResolution').warnings[0].hosts.join(' ');
+      newContent += content.findProperty('category', 'hostNameResolution').warnings[0].hosts.join('<br>');
     }
     if (content.findProperty('category', 'firewall').warnings.length) {
       newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.firewall');
@@ -435,7 +435,7 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
       });
     }
     if (hostResolutionWarnings && hostResolutionWarnings.length) {
-      hostResolutionWarnings[0].hosts.forEach(function (_hostName) {
+      hostResolutionWarnings[0].hostsNames.forEach(function (_hostName) {
         if (!hostNameMap[_hostName]) {
           hostNameMap[_hostName] = true;
         }