Repository: ambari Updated Branches: refs/heads/trunk 587482301 -> dc27f4a08
AMBARI-6029 Hostname resolution check reports error while hosts are resolvable. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dc27f4a0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dc27f4a0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dc27f4a0 Branch: refs/heads/trunk Commit: dc27f4a08ff8fc0145672af19024da7004ecc6cc Parents: 5874823 Author: aBabiichuk <[email protected]> Authored: Thu Jun 5 16:59:56 2014 +0300 Committer: aBabiichuk <[email protected]> Committed: Thu Jun 5 16:59:56 2014 +0300 ---------------------------------------------------------------------- .../app/controllers/wizard/step3_controller.js | 23 ++++++++++---------- ambari-web/app/views/wizard/step3_view.js | 4 ++-- 2 files changed, 14 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/dc27f4a0/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 bf16265..cd32d91 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -213,6 +213,7 @@ App.WizardStep3Controller = Em.Controller.extend({ this.set('isLoaded', false); this.disablePreviousSteps(); this.clearStep(); + App.router.get('clusterController').loadAmbariProperties(); this.loadHosts(); }, @@ -756,11 +757,13 @@ App.WizardStep3Controller = Em.Controller.extend({ getHostNameResolution: function () { var hosts = this.get('bootHosts').getEach('name').join(","); + var jdk_location = App.router.get('clusterController.ambariProperties.jdk_location'); var RequestInfo = { "action": "check_host", "context": "Check host", "parameters": { "check_execute_list": "host_resolution_check", + "jdk_location" : jdk_location, "hosts": hosts, "threshold": "20" } @@ -802,7 +805,6 @@ App.WizardStep3Controller = Em.Controller.extend({ getHostCheckTasks: function () { var requestId = this.get("requestId"); var self = this; - this.set('startChecking', new Date().getTime()); var checker = setInterval(function () { if (self.get('stopChecking') == true) { clearInterval(checker); @@ -834,12 +836,14 @@ App.WizardStep3Controller = Em.Controller.extend({ } this.set('stopChecking', true); data.tasks.forEach(function (task) { - var cur = new Date().getTime(); var name = Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.error'); var hostInfo = this.get("hostCheckWarnings").findProperty('name', name); - if (task.Tasks.status == "FAILED" || (cur - this.get('startChecking') > 5000) || task.Tasks.status == "COMPLETED") { - if (task.Tasks.status == "COMPLETED" && Em.get(task, 'Tasks.structured_out.host_resolution_check.failed_count') == 0) { - return; + if (task.Tasks.status == "FAILED" || task.Tasks.status == "COMPLETED" || task.Tasks.status == "TIMEDOUT") { + if (task.Tasks.status == "COMPLETED") { + var structured_out = jQuery.parseJSON(task.Tasks.structured_out); + if(structured_out && structured_out.host_resolution_check.failed_count == 0) { + return; + } } if (!hostInfo) { hostInfo = { @@ -849,7 +853,9 @@ App.WizardStep3Controller = Em.Controller.extend({ }; this.get("hostCheckWarnings").push(hostInfo); } else { - hostInfo.hosts.push(task.Tasks.host_name); + if (!hostInfo.hosts.contains(task.Tasks.host_name)) { + hostInfo.hosts.push(task.Tasks.host_name); + } } } else { this.set('stopChecking', false); @@ -860,11 +866,6 @@ App.WizardStep3Controller = Em.Controller.extend({ stopChecking: false, /** - * startChecking {Number} - timestamp - */ - startChecking: 0, - - /** * @method getHostCheckTasksError */ getHostCheckTasksError: function() { http://git-wip-us.apache.org/repos/asf/ambari/blob/dc27f4a0/ambari-web/app/views/wizard/step3_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/step3_view.js b/ambari-web/app/views/wizard/step3_view.js index d9dca76..1466d2c 100644 --- a/ambari-web/app/views/wizard/step3_view.js +++ b/ambari-web/app/views/wizard/step3_view.js @@ -276,7 +276,7 @@ App.WizardStep3View = App.TableView.extend({ this.set('message', Em.I18n.t('installer.step3.warning.loading')); } else { - if (this.get('controller.isHostHaveWarnings') || this.get('controller.repoCategoryWarnings.length') || this.get('controller.diskCategoryWarnings.length')) { + if (this.get('controller.isHostHaveWarnings') || this.get('controller.repoCategoryWarnings.length') || this.get('controller.diskCategoryWarnings.length') || this.get('controller.hostCheckWarnings')) { this.set('status', 'alert-warn'); this.set('linkText', Em.I18n.t('installer.step3.warnings.linkText')); this.set('message', Em.I18n.t('installer.step3.warnings.fails').format(hosts.length - failedHosts)); @@ -303,7 +303,7 @@ App.WizardStep3View = App.TableView.extend({ } } } - }.observes('controller.isWarningsLoaded', 'controller.isHostHaveWarnings', 'controller.repoCategoryWarnings', 'controller.diskCategoryWarnings') + }.observes('controller.isWarningsLoaded', 'controller.isHostHaveWarnings', 'controller.repoCategoryWarnings', 'controller.diskCategoryWarnings', 'controller.hostCheckWarnings') });
