You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/05/25 21:01:24 UTC

[1/2] ambari git commit: AMBARI-11374. After Adding A New Service dfs.namenode.checkpoint.dir Is Removed (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 043357d8d -> 46b159a2d


AMBARI-11374. After Adding A New Service dfs.namenode.checkpoint.dir Is Removed (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 46b159a2d81973d12363943f518ba74b66ebc529
Parents: c035bda
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon May 25 21:32:58 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon May 25 21:50:02 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js |  4 +---
 ambari-web/app/controllers/wizard/step7_controller.js   |  4 +---
 ambari-web/test/controllers/wizard/step7_test.js        | 12 ++++++------
 3 files changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46b159a2/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 7207e1c..5e49ae8 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -830,9 +830,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
         if (App.get('isHaEnabled')) {
           var c = serviceConfig.configs,
             removedConfigs = c.filterProperty('category', 'SECONDARY_NAMENODE');
-          removedConfigs.map(function (config) {
-            c = c.without(config);
-          });
+          removedConfigs.setEach('isVisible', false);
           serviceConfig.configs = c;
         }
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/46b159a2/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 59bcc63..b8771e5 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -754,9 +754,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
         var c = serviceConfigs.findProperty('serviceName', 'HDFS').configs,
           nameServiceId = c.findProperty('name', 'dfs.nameservices'),
           removedConfigs = c.filterProperty('category', 'SECONDARY_NAMENODE');
-        removedConfigs.map(function (config) {
-          c = c.without(config);
-        });
+        removedConfigs.setEach('isVisible', false);
         serviceConfigs.findProperty('serviceName', 'HDFS').configs = c;
 
         if(this.get('selectedServiceNames').contains('HBASE') && nameServiceId){

http://git-wip-us.apache.org/repos/asf/ambari/blob/46b159a2/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js
index 7eeaa82..acd3fbf 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -1254,11 +1254,11 @@ describe('App.InstallerStep7Controller', function () {
         Em.Object.create({
           serviceName: 'HDFS',
           configs: [
-            {category: 'SECONDARY_NAMENODE'},
-            {category: 'SECONDARY_NAMENODE'},
-            {category: 'NameNode'},
-            {category: 'NameNode'},
-            {category: 'SECONDARY_NAMENODE'}
+            Em.Object.create({category: 'SECONDARY_NAMENODE'}),
+            Em.Object.create({category: 'SECONDARY_NAMENODE'}),
+            Em.Object.create({category: 'NameNode'}),
+            Em.Object.create({category: 'NameNode'}),
+            Em.Object.create({category: 'SECONDARY_NAMENODE'})
           ]
         }),
         Em.Object.create({serviceName: 's2'})]
@@ -1271,7 +1271,7 @@ describe('App.InstallerStep7Controller', function () {
       installerStep7Controller.setStepConfigs([], []);
       expect(installerStep7Controller.get('stepConfigs').everyProperty('showConfig', true)).to.equal(true);
       expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('selected')).to.equal(true);
-      expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('configs').length).to.equal(2);
+      expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('configs').length).to.equal(5);
       App.get.restore();
     });
 


[2/2] ambari git commit: AMBARI-11373. [WinTP2] HDPWIN 2.2 HDFS configuration: Error count on the Advanced tab is 3, yet no properties are invalid (alexantonenko)

Posted by al...@apache.org.
AMBARI-11373. [WinTP2] HDPWIN 2.2 HDFS configuration: Error count on the Advanced tab is 3, yet no properties are invalid (alexantonenko)


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

Branch: refs/heads/trunk
Commit: c035bdadd1ccef6428e8083282b3a3fa67ee0e12
Parents: 043357d
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon May 25 21:26:46 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon May 25 21:50:02 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/utils/config.js       | 19 ++++++++++++++++++-
 ambari-web/test/utils/config_test.js |  7 +++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c035bdad/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index bf84592..a7fd14c 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -76,6 +76,7 @@ App.config = Em.Object.create({
   setPreDefinedServiceConfigs: function (isMiscTabToBeAdded) {
     var configs = this.get('preDefinedSiteProperties');
     var services = [];
+    var self = this;
     var stackServices = App.StackService.find().filterProperty('id');
     // Only include services that has configTypes related to them for service configuration page
     var servicesWithConfigTypes = stackServices.filter(function (service) {
@@ -102,7 +103,15 @@ App.config = Em.Object.create({
     }
 
     allTabs.forEach(function (service) {
-      var serviceConfigs = configs.filterProperty('serviceName', service.get('serviceName'));
+      var configTypes = Em.keys(service.get('configTypes'));
+      // filter properties by service name and service config types
+      var serviceConfigs = configs.filterProperty('serviceName', service.get('serviceName')).filter(function(property) {
+        var propFilename = self.getConfigTagFromFileName(Em.getWithDefault(property, 'filename', ''));
+        if (propFilename && service.get('serviceName') != 'MISC') {
+          return configTypes.contains(propFilename);
+        }
+        return true;
+      });
       service.set('configs', serviceConfigs);
       services.push(service);
     });
@@ -497,12 +506,20 @@ App.config = Em.Object.create({
     var preDefinedNames = preDefinedConfigs.mapProperty('name');
     var storedNames = storedConfigs.mapProperty('name');
     var names = preDefinedNames.concat(storedNames).uniq();
+    var configTypes = Em.keys(App.StackService.find().filter(function(service) {
+      return selectedServiceNames.contains(service.get('serviceName'));
+    }).mapProperty('configTypes'))
+      .uniq().compact().filter(function(configType) { return !!configType; });
+
     names.forEach(function (name) {
       var storedCfgs = storedConfigs.filterProperty('name', name);
       var preDefinedCfgs = [];
       var preDefinedConfig = preDefinedConfigs.filterProperty('name', name);
       preDefinedConfig.forEach(function (_preDefinedConfig) {
         if (selectedServiceNames.contains(_preDefinedConfig.serviceName) || _preDefinedConfig.serviceName === 'MISC') {
+          if (_preDefinedConfig.serviceName != 'MISC' && _preDefinedConfig.filename && !configTypes.contains(_preDefinedConfig.filename)) {
+            return;
+          }
           preDefinedCfgs.push(_preDefinedConfig);
         }
       }, this);

http://git-wip-us.apache.org/repos/asf/ambari/blob/c035bdad/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 42d580d..d382a60 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -472,6 +472,13 @@ describe('App.config', function () {
       var miscCategory = App.config.get('preDefinedServiceConfigs').findProperty('serviceName', 'MISC');
       expect(Em.keys(miscCategory.get('configTypes'))).to.eql(['cluster-env', 'hadoop-env', 'oozie-env']);
     });
+
+    it('should not load configs for missed config types', function() {
+      var hdfsService = App.config.get('preDefinedServiceConfigs').findProperty('serviceName', 'HDFS');
+      var rangerRelatedConfigs = hdfsService.get('configs').filterProperty('filename', 'ranger-hdfs-plugin-properties.xml');
+      expect(rangerRelatedConfigs.length).to.be.eql(0);
+      expect(hdfsService.get('configs.length') > 0).to.be.true;
+    });
   });
   
   describe('#isManagedMySQLForHiveAllowed', function () {