Repository: ambari
Updated Branches:
  refs/heads/trunk b8eccc7e8 -> ce9f4f091


AMBARI-11301. 'SNameNode host' value not displayed with NameNode HA enabled 
(onechiporenko)


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

Branch: refs/heads/trunk
Commit: ce9f4f091b90af33c428c550519825c391649911
Parents: b8eccc7
Author: Oleg Nechiporenko <[email protected]>
Authored: Thu May 21 17:27:27 2015 +0300
Committer: Oleg Nechiporenko <[email protected]>
Committed: Thu May 21 17:27:27 2015 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    | 13 ++++++---
 .../app/controllers/wizard/step7_controller.js  |  3 ---
 ambari-web/app/utils/config.js                  |  9 -------
 ambari-web/test/utils/config_test.js            | 28 --------------------
 4 files changed, 10 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ce9f4f09/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index b6cb26a..f6a9600 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -810,11 +810,18 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.ServerValidatorM
     serviceNames.forEach(function(serviceName) {
       var serviceConfig = App.config.createServiceConfig(serviceName);
       //Make SecondaryNameNode invisible on enabling namenode HA
-      if (serviceConfig.get('serviceName') === 'HDFS') {
-        App.config.OnNnHAHideSnn(serviceConfig);
-      }
       var configsByService = 
this.get('allConfigs').filterProperty('serviceName', serviceName);
       this.loadConfigs(configsByService, serviceConfig);
+      if (serviceConfig.get('serviceName') === 'HDFS') {
+        if (App.get('isHaEnabled')) {
+          var c = serviceConfig.configs,
+            removedConfigs = c.filterProperty('category', 
'SECONDARY_NAMENODE');
+          removedConfigs.map(function (config) {
+            c = c.without(config);
+          });
+          serviceConfig.configs = c;
+        }
+      }
 
       this.get('stepConfigs').pushObject(serviceConfig);
     }, this);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ce9f4f09/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index 3f3cafb..fceb16c 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -407,9 +407,6 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
     var serviceName = configs[0].serviceName,
       service = this.get('stepConfigs').findProperty('serviceName', 
serviceName);
     var serviceConfig = App.config.createServiceConfig(serviceName);
-    if (serviceConfig.get('serviceName') === 'HDFS') {
-      App.config.OnNnHAHideSnn(serviceConfig);
-    }
     service.set('selectedConfigGroup', this.get('preSelectedConfigGroup'));
     this.loadComponentConfigs(service.get('configs'), serviceConfig, service);
     service.set('configs', serviceConfig.get('configs'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/ce9f4f09/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index d1df556..1844482 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1452,15 +1452,6 @@ App.config = Em.Object.create({
     return ((rez == '') || (rez == undefined)) ? value : rez;
   },
 
-  OnNnHAHideSnn: function (ServiceConfig) {
-    var configCategories = ServiceConfig.get('configCategories');
-    var snCategory = configCategories.findProperty('name', 'SNameNode');
-    var isSnnPresent = !!App.HDFSService.find('HDFS').get('snameNode');
-    if (snCategory && !isSnnPresent) {
-      configCategories.removeObject(snCategory);
-    }
-  },
-
   /**
    * exclude configs that depends on services which are uninstalled
    * if config doesn't have serviceName or dependent service is installed then

http://git-wip-us.apache.org/repos/asf/ambari/blob/ce9f4f09/ambari-web/test/utils/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/config_test.js 
b/ambari-web/test/utils/config_test.js
index ae85b15..42d580d 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -355,34 +355,6 @@ describe('App.config', function () {
     });
   });
 
-  describe('#OnNnHAHideSnn()', function() {
-    it('`SNameNode` category present in `ServiceConfig`. It should be 
removed.', function() {
-      App.store.load(App.HDFSService, {
-        'id': 'HDFS'
-      });
-      var ServiceConfig = Em.Object.create({
-        configCategories: [ { name: 'SNameNode' } ]
-      });
-      
expect(ServiceConfig.get('configCategories').findProperty('name','SNameNode')).to.ok;
-      App.config.OnNnHAHideSnn(ServiceConfig);
-      
expect(ServiceConfig.get('configCategories').findProperty('name','SNameNode')).to.undefined;
-      var record = App.HDFSService.find('HDFS');
-      record.deleteRecord();
-      record.get('stateManager').transitionTo('loading');
-    });
-    it('`SNameNode` category absent in `ServiceConfig`. Nothing to do.', 
function() {
-      App.store.load(App.HDFSService, {
-        'id': 'HDFS'
-      });
-      var ServiceConfig = Em.Object.create({
-        configCategories: [ { name: 'DataNode' } ]
-      });
-      App.config.OnNnHAHideSnn(ServiceConfig);
-      
expect(ServiceConfig.get('configCategories').findProperty('name','DataNode')).to.ok;
-      expect(ServiceConfig.get('configCategories.length')).to.eql(1);
-    });
-  });
-
   describe('#preDefinedConfigFile', function() {
     before(function() {
       setups.setupStackVersion(this, 'BIGTOP-0.8');

Reply via email to