Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 0053a9ac2 -> e3e3d5c14


AMBARI-12423. Ambari - Deleting a Zookeeper server doesn't update the the 
storm.zookeeper.servers property for Storm (alexantonenko)


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

Branch: refs/heads/branch-2.1
Commit: 09346edf0953e4b358fa903fa806e6140eb1ea85
Parents: 0053a9a
Author: Alex Antonenko <hiv...@gmail.com>
Authored: Tue Jul 21 13:02:44 2015 +0300
Committer: Alex Antonenko <hiv...@gmail.com>
Committed: Tue Jul 21 13:02:44 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js | 36 ++++++++++++++++----
 .../test/controllers/main/host/details_test.js  |  2 +-
 2 files changed, 31 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/09346edf/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 93ecf25..94ba5ec 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -346,6 +346,7 @@ App.MainHostDetailsController = Em.Controller.extend({
     this.removeHostComponentModel(data.componentName, data.hostName);
     if (data.componentName == 'ZOOKEEPER_SERVER') {
       this.set('fromDeleteZkServer', true);
+      this.updateStormConfigs();
       this.loadConfigs();
     } else if (data.componentName == 'HIVE_METASTORE') {
       this.set('deleteHiveMetaStore', true);
@@ -697,6 +698,19 @@ App.MainHostDetailsController = Em.Controller.extend({
   },
 
   /**
+   * Update zk configs
+   * @param {object} configs
+   * @method updateZkConfigs
+   */
+  updateZkConfigs: function(configs) {
+    var zks = this.getZkServerHosts();
+    var portValue = configs['zoo.cfg'] && Em.get(configs['zoo.cfg'], 
'clientPort');
+    var zkPort = typeof portValue === 'udefined' ? '2181' : portValue;
+    var zksWithPort = this.concatZkNames(zks, zkPort);
+    this.setZKConfigs(configs, zksWithPort, zks);
+  },
+
+  /**
    * update and save Storm related configs to server
    * @param {object} data
    * @method onLoadStormConfigs
@@ -712,6 +726,8 @@ App.MainHostDetailsController = Em.Controller.extend({
       attributes[item.type] = item.properties_attributes || {};
     }, this);
 
+    this.updateZkConfigs(configs);
+
     configs['storm-site']['nimbus.seeds'] = 
JSON.stringify(stormNimbusHosts).replace(/"/g, "'");
     var groups = [
       {
@@ -1018,6 +1034,16 @@ App.MainHostDetailsController = Em.Controller.extend({
     this.showBackgroundOperationsPopup();
   },
 
+   /**
+   * Update storm config
+   * @method updateStormConfigs
+   */
+  updateStormConfigs: function() {
+    if (App.Service.find().findProperty('serviceName', 'STORM')) {
+      this.loadConfigs("loadStormConfigs");
+    }
+  },
+
   /**
    * Load tags
    * @method checkZkConfigs
@@ -1028,6 +1054,7 @@ App.MainHostDetailsController = Em.Controller.extend({
       var self = this;
       
this.removeObserver('App.router.backgroundOperationsController.serviceTimestamp',
 this, this.checkZkConfigs);
       setTimeout(function () {
+        self.updateStormConfigs();
         self.loadConfigs();
       }, App.get('componentsUpdateInterval'));
     }
@@ -1116,11 +1143,8 @@ App.MainHostDetailsController = Em.Controller.extend({
       attributes[item.type] = item.properties_attributes || {};
     }, this);
 
-    var zks = this.getZkServerHosts();
-    var portValue = configs['zoo.cfg'] && Em.get(configs['zoo.cfg'], 
'clientPort');
-    var zkPort = typeof portValue === 'udefined' ? '2181' : portValue;
-    var zksWithPort = this.concatZkNames(zks, zkPort);
-    this.setZKConfigs(configs, zksWithPort, zks);
+    this.updateZkConfigs(configs);
+
     var groups = [
       {
         properties: {
@@ -1856,7 +1880,7 @@ App.MainHostDetailsController = Em.Controller.extend({
       runningComponents: [],
       nonDeletableComponents: [],
       unknownComponents: []
-    }; 
+    };
     var self = this;
     if (componentsOnHost && componentsOnHost.get('length') > 0) {
       componentsOnHost.forEach(function (cInstance) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/09346edf/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 1883c70..cd35981 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -1049,7 +1049,7 @@ describe('App.MainHostDetailsController', function () {
       var popup = controller.installComponent(event);
       expect(App.ModalPopup.show.calledOnce).to.be.true;
       popup.onPrimary();
-      expect(App.ajax.send.calledOnce).to.be.true;
+      expect(App.ajax.send.called).to.be.true;
     });
   });
 

Reply via email to