Repository: ambari Updated Branches: refs/heads/trunk 54c5fbe17 -> 766cb64ef
AMBARI-10623 Mysterious "nfs.dump.dir" and "nfs.exports.allowed.hosts" warnings occur for HDFS. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/766cb64e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/766cb64e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/766cb64e Branch: refs/heads/trunk Commit: 766cb64ef58882a57a205c90953cbd1be473437c Parents: 54c5fbe Author: aBabiichuk <ababiic...@cybervisiontech.com> Authored: Tue Apr 21 09:24:17 2015 +0300 Committer: aBabiichuk <ababiic...@cybervisiontech.com> Committed: Tue Apr 21 09:24:17 2015 +0300 ---------------------------------------------------------------------- ambari-web/app/data/HDP2/site_properties.js | 6 ++++++ ambari-web/app/utils/config.js | 13 +++++++++++-- ambari-web/test/utils/config_test.js | 15 +++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/766cb64e/ambari-web/app/data/HDP2/site_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js index b5cfa77..f31d826 100644 --- a/ambari-web/app/data/HDP2/site_properties.js +++ b/ambari-web/app/data/HDP2/site_properties.js @@ -119,6 +119,9 @@ var hdp2properties = [ "category": "NFS_GATEWAY", "serviceName": "HDFS", "filename": "hdfs-site.xml", + "stack": { + "HDP": "2.3" + }, "index": 1 }, { @@ -141,6 +144,9 @@ var hdp2properties = [ "category": "NFS_GATEWAY", "serviceName": "HDFS", "filename": "hdfs-site.xml", + "stack": { + "HDP": "2.3" + }, "index": 3 }, { http://git-wip-us.apache.org/repos/asf/ambari/blob/766cb64e/ambari-web/app/utils/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index 5c65e9e..be50419 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -112,6 +112,8 @@ App.config = Em.Object.create({ preDefinedSiteProperties: function () { var sitePropertiesForCurrentStack = this.preDefinedConfigFile('site_properties'); + // default is HDP2 + var configProperties = require('data/HDP2/site_properties').configProperties; if (sitePropertiesForCurrentStack) { return sitePropertiesForCurrentStack.configProperties; } @@ -120,9 +122,16 @@ App.config = Em.Object.create({ return require('data/HDP2.3/site_properties').configProperties; } if (App.get('isHadoop22Stack')) { - return require('data/HDP2.2/site_properties').configProperties; + configProperties = require('data/HDP2.2/site_properties').configProperties; } - return require('data/HDP2/site_properties').configProperties; + // filter config properties by stack name and version if defined + return configProperties.filter(function(item) { + if (item.stack) { + var stackVersion = item.stack[App.get('currentStackName')]; + return stackVersion && stringUtils.compareVersions(App.get('currentStackVersionNumber'), stackVersion) > -1; + } + return true; + }); }.property('App.isHadoop22Stack', 'App.isHadoop23Stack', 'App.currentStackName'), preDefinedConfigFile: function(file) { http://git-wip-us.apache.org/repos/asf/ambari/blob/766cb64e/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 7b5aebe..6a4563c 100644 --- a/ambari-web/test/utils/config_test.js +++ b/ambari-web/test/utils/config_test.js @@ -395,6 +395,21 @@ describe('App.config', function () { }); }); + describe('#preDefinedSiteProperties-stack-attribute', function() { + var HDP23Only = ['nfs.dump.dir', 'nfs.exports.allowed.hosts']; + it('should ignore properties that not belongs to stack HDP - 2.2', function() { + setups.setupStackVersion(this, 'HDP-2.2'); + expect(App.config.get('preDefinedSiteProperties').mapProperty('name')).to.not.include.members(HDP23Only); + setups.restoreStackVersion(this); + }); + + it('properties related to HDP-2.3 stack only should be present', function() { + setups.setupStackVersion(this, 'HDP-2.3'); + expect(App.config.get('preDefinedSiteProperties').mapProperty('name')).to.include.members(HDP23Only); + setups.restoreStackVersion(this); + }); + }); + describe('#generateConfigPropertiesByName', function() { var tests = [ {