Repository: ambari Updated Branches: refs/heads/trunk b7c9651ec -> 43dc645ec
AMBARI-5842 Usability: add Reverse Lookup validation to Host Checks UI. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/43dc645e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/43dc645e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/43dc645e Branch: refs/heads/trunk Commit: 43dc645ecb24f1cba8d84994266612c8ffe440e8 Parents: b7c9651 Author: aBabiichuk <ababiic...@cybervisiontech.com> Authored: Wed May 21 18:56:38 2014 +0300 Committer: aBabiichuk <ababiic...@cybervisiontech.com> Committed: Wed May 21 18:56:53 2014 +0300 ---------------------------------------------------------------------- .../wizard/bootstrap/two_hosts_information.json | 2 ++ .../app/controllers/wizard/step3_controller.js | 17 +++++++++++++++++ ambari-web/app/messages.js | 5 +++++ .../wizard/step3/hostWarningPopupBody_view.js | 12 ++++++++++++ .../wizard/step3/hostWarningPopupBody_view_test.js | 5 +++++ 5 files changed, 41 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/43dc645e/ambari-web/app/assets/data/wizard/bootstrap/two_hosts_information.json ---------------------------------------------------------------------- diff --git a/ambari-web/app/assets/data/wizard/bootstrap/two_hosts_information.json b/ambari-web/app/assets/data/wizard/bootstrap/two_hosts_information.json index 542ee6a..412ce63 100644 --- a/ambari-web/app/assets/data/wizard/bootstrap/two_hosts_information.json +++ b/ambari-web/app/assets/data/wizard/bootstrap/two_hosts_information.json @@ -195,6 +195,7 @@ } ] }, + "reverseLookup": false, "umask" : 18 }, "total_mem" : 7644119 @@ -324,6 +325,7 @@ } ] }, + "reverseLookup": false, "umask" : 19 }, "total_mem" : 7644119 http://git-wip-us.apache.org/repos/asf/ambari/blob/43dc645e/ambari-web/app/controllers/wizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js index ba2e07d..819f562 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -1183,6 +1183,23 @@ App.WizardStep3Controller = Em.Controller.extend({ }, this); } + if (_host.Hosts.last_agent_env.reverseLookup === false) { + var name = Em.I18n.t('installer.step3.hostWarningsPopup.reverseLookup.name'); + warning = warnings.filterProperty('category', 'reverseLookup').findProperty('name', name); + if (warning) { + warning.hosts.push(_host.Hosts.host_name); + warning.onSingleHost = false; + } else { + warning = { + name: name, + hosts: [_host.Hosts.host_name], + category: 'reverseLookup', + onSingleHost: true + }; + warnings.push(warning); + } + host.warnings.push(warning); + } hosts.push(host); }, this); http://git-wip-us.apache.org/repos/asf/ambari/blob/43dc645e/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 575047c..c3794a2 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -454,6 +454,7 @@ Em.I18n.translations = { 'installer.step3.hostWarningsPopup.report.hosts': '<br>######################################<br><br>######################################<br># Hosts<br>#<br># A space delimited list of hosts which have issues.<br># Provided so that administrators can easily copy hostnames into scripts, email etc.<br>######################################<br>HOSTS<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>', 'installer.step3.hostWarningsPopup.report.process': '<br><br>######################################<br># Processes<br>#<br># A comma separated list of process tuples which should not be running.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br>######################################<br>PROCESSES<br>', 'installer.step3.hostWarningsPopup.report.package': '<br><br>######################################<br># Packages<br>#<br># A space delimited list of software packages which should be uninstalled.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br># Example: yum remove hadoop-hdfs nagios<br>######################################<br>PACKAGES<br>', 'installer.step3.hostWarningsPopup.report.service': '<br><br>######################################<br># Services<br>#<br># A space delimited list of services which should be up and running.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br># Example: services start ntpd httpd<br>######################################<br>SERVICES<br>', @@ -507,6 +508,10 @@ Em.I18n.translations = { 'installer.step3.hostWarningsPopup.empty.firewall':'firewalls running', 'installer.step3.hostWarningsPopup.empty.repositories':'repositories OS type mis-match with registered hosts', 'installer.step3.hostWarningsPopup.empty.disk':'disk space issues', + 'installer.step3.hostWarningsPopup.reverseLookup.name': 'Reverse Lookup validation failed on', + 'installer.step3.hostWarningsPopup.reverseLookup': 'Reverse Lookup issues', + 'installer.step3.hostWarningsPopup.reverseLookup.message': 'The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. Please check the DNS setup and fix the issue.', + 'installer.step3.hostWarningsPopup.reverseLookup.empty': 'hosts failed DNS lookup validation', 'installer.step3.hostWarningsPopup.action.exists':'Exists on', 'installer.step3.hostWarningsPopup.action.notRunning':'Not running on', 'installer.step3.hostWarningsPopup.action.installed':'Installed on', http://git-wip-us.apache.org/repos/asf/ambari/blob/43dc645e/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js b/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js index 9b42cfe..8e9ce47 100644 --- a/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js +++ b/ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js @@ -245,6 +245,14 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({ action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'), category: 'alternatives', isCollapsed: true + }), + Em.Object.create({ + warnings: categoryWarnings.filterProperty('category', 'reverseLookup'), + title: Em.I18n.t('installer.step3.hostWarningsPopup.reverseLookup'), + message: Em.I18n.t('installer.step3.hostWarningsPopup.reverseLookup.message'), + emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.reverseLookup.empty'), + category: 'reverseLookup', + isCollapsed: true }) ] }.property('category', 'warningsByHost'), @@ -281,6 +289,10 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({ newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.fileFolders'); newContent += content.findProperty('category', 'fileFolders').warnings.mapProperty('name').join(' '); } + if (content.findProperty('category', 'reverseLookup').warnings.length) { + newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.reverseLookup'); + newContent += content.findProperty('category', 'reverseLookup').warnings[0].hosts.join(' '); + } if (content.findProperty('category', 'process').warnings.length) { newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.process'); content.findProperty('category', 'process').warnings.forEach(function (process, i) { http://git-wip-us.apache.org/repos/asf/ambari/blob/43dc645e/ambari-web/test/views/wizard/step3/hostWarningPopupBody_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/wizard/step3/hostWarningPopupBody_view_test.js b/ambari-web/test/views/wizard/step3/hostWarningPopupBody_view_test.js index 840ce97..70bded3 100644 --- a/ambari-web/test/views/wizard/step3/hostWarningPopupBody_view_test.js +++ b/ambari-web/test/views/wizard/step3/hostWarningPopupBody_view_test.js @@ -144,6 +144,7 @@ describe('App.WizardStep3HostWarningPopupBody', function() { var content = [ {category: 'firewall', warnings: [{name: 'n1'}, {name: 'n2'}, {name: 'n3'}]}, {category: 'fileFolders', warnings: [{name: 'n4'}, {name: 'n5'}, {name: 'n6'}]}, + {category: 'reverseLookup', warnings: [{name: 'n19', hosts: ["h1"]}]}, { category: 'process', warnings: [ @@ -194,6 +195,10 @@ describe('App.WizardStep3HostWarningPopupBody', function() { var newContent = view.get('contentInDetails'); expect(newContent.contains('n16 n17 n18')).to.equal(true); }); + it('should map reverse lookup warnings', function() { + var newContent = view.get('contentInDetails'); + expect(newContent.contains('h1')).to.equal(true); + }); }); }); \ No newline at end of file