Explorar o código

AMBARI-12787. Add Host is only performing Hostname Resolution check for added hosts (akovalenko)

Aleksandr Kovalenko %!s(int64=9) %!d(string=hai) anos
pai
achega
3299ce44ec
Modificáronse 1 ficheiros con 14 adicións e 4 borrados
  1. 14 4
      ambari-web/app/controllers/wizard/step3_controller.js

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

@@ -80,6 +80,14 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
     return this.get('isRegistrationInProgress') || !this.get('isWarningsLoaded');
   }.property('isRegistrationInProgress', 'isWarningsLoaded'),
 
+  /**
+   * Controller is using in Add Host Wizard
+   * @return {bool}
+   */
+  isAddHostWizard: function () {
+    return this.get('content.controllerName') === 'addHostController';
+  }.property('content.controllerName'),
+
   /**
    * @type {bool}
    */
@@ -940,12 +948,14 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
    * @param {string} checkExecuteList - for now supported:
    *  <code>"last_agent_env_check"<code>
    *  <code>"host_resolution_check"<code>
-   * @param {boolean} addHosts - true
+   * @param {boolean} addHostsParameter - define whether add hosts parameter to RequestInfo
    * @return {object|null}
    * @method getDataForCheckRequest
    */
-  getDataForCheckRequest: function (checkExecuteList, addHosts) {
-    var hosts = this.get('bootHosts').filterProperty('bootStatus', 'REGISTERED').getEach('name').join(",");
+  getDataForCheckRequest: function (checkExecuteList, addHostsParameter) {
+    var newHosts = this.get('bootHosts').filterProperty('bootStatus', 'REGISTERED').getEach('name');
+    var hosts = this.get('isAddHostWizard') ? [].concat.apply([], App.MasterComponent.find().mapProperty('hostNames')).concat(newHosts).uniq() : newHosts;
+    hosts = hosts.join(',');
     if (hosts.length == 0) return null;
     var jdk_location = App.router.get('clusterController.ambariProperties.jdk_location');
     var RequestInfo = {
@@ -957,7 +967,7 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
         "threshold": "20"
       }
     };
-    if (addHosts) {
+    if (addHostsParameter) {
       RequestInfo.parameters.hosts = hosts;
     }
     var resource_filters = {