You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2017/02/07 16:49:39 UTC

ambari git commit: AMBARI-19896 Unable to add ZooKeeper Server to host. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 3561cf7be -> a6a7ba6d3


AMBARI-19896 Unable to add ZooKeeper Server to host. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a6a7ba6d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a6a7ba6d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a6a7ba6d

Branch: refs/heads/trunk
Commit: a6a7ba6d3defc89f9ef0433913581662b567b94a
Parents: 3561cf7
Author: ababiichuk <ab...@hortonworks.com>
Authored: Tue Feb 7 18:09:05 2017 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Tue Feb 7 18:09:05 2017 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js | 69 ++++++++++++--------
 .../test/controllers/main/host/details_test.js  |  6 ++
 2 files changed, 47 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a6a7ba6d/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 093603e..2f18fcb 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -1278,36 +1278,48 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
    * @param host
    */
   saveConfigsBatch: function (groups, componentName, host) {
-    groups.forEach(function (group) {
-      var desiredConfigs = [],
-        tag = 'version' + (new Date).getTime(),
-        properties = group.properties;
-
-      for (var site in properties) {
-        if (!properties.hasOwnProperty(site) || Em.isNone(properties[site])) continue;
-        desiredConfigs.push({
-          "type": site,
-          "tag": tag,
-          "properties": properties[site],
-          "properties_attributes": group.properties_attributes[site],
-          "service_config_version_note": Em.I18n.t('hosts.host.configs.save.note').format(App.format.role(componentName, false))
-        });
-      }
-      if (desiredConfigs.length > 0) {
-        App.ajax.send({
-          name: 'common.service.configurations',
-          sender: this,
-          data: {
-            desired_config: desiredConfigs,
+    if (groups.length) {
+      groups.forEach(function (group) {
+        var desiredConfigs = [],
+          tag = 'version' + (new Date).getTime(),
+          properties = group.properties;
+
+        for (var site in properties) {
+          if (!properties.hasOwnProperty(site) || Em.isNone(properties[site])) continue;
+          desiredConfigs.push({
+            "type": site,
+            "tag": tag,
+            "properties": properties[site],
+            "properties_attributes": group.properties_attributes[site],
+            "service_config_version_note": Em.I18n.t('hosts.host.configs.save.note').format(App.format.role(componentName, false))
+          });
+        }
+        if (desiredConfigs.length > 0) {
+          App.ajax.send({
+            name: 'common.service.configurations',
+            sender: this,
+            data: {
+              desired_config: desiredConfigs,
+              componentName: componentName,
+              host: host
+            },
+            success: 'installHostComponent'
+          });
+        } else {
+          this.installHostComponent(null, null, {
             componentName: componentName,
             host: host
-          },
-          success: 'installHostComponent'
-        });
-      }
-      //clear hive metastore host not to send second request to install component
-      host = null;
-    }, this);
+          });
+        }
+        //clear hive metastore host not to send second request to install component
+        host = null;
+      }, this);
+    } else {
+      this.installHostComponent(null, null, {
+        componentName: componentName,
+        host: host
+      });
+    }
   },
 
   /**
@@ -1608,6 +1620,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
       this.trackRequest(request);
       return true;
     }
+    this.set('isConfigsLoadingInProgress', false);
     return false;
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6a7ba6d/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index 4eccf95..7f3fcf7 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -963,6 +963,12 @@ describe('App.MainHostDetailsController', function () {
       var args = testHelpers.findAjaxRequest('name', 'reassign.load_configs');
       expect(args).exists;
     });
+    it('isConfigsLoadingInProgress is false', function () {
+      mockUrlParams = [];
+      controller.set('isConfigsLoadingInProgress', true);
+      controller.loadConfigsSuccessCallback(null, null, {});
+      expect(controller.get('isConfigsLoadingInProgress')).to.be.false;
+    });
   });
 
   describe('#saveZkConfigs()', function () {