This is an automated email from the ASF dual-hosted git repository. ishanbha pushed a commit to branch branch-2.7 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push: new e97f6df AMBARI-24237. UI Install: Custom Yarn Capacity Scheduler property set is missing after deploy. (jaimin) (#1665) e97f6df is described below commit e97f6dfe3ea44eeed40cab682880b9e63f090f6e Author: Jetly <jai...@hortonworks.com> AuthorDate: Mon Jul 2 22:35:30 2018 -0700 AMBARI-24237. UI Install: Custom Yarn Capacity Scheduler property set is missing after deploy. (jaimin) (#1665) --- ambari-web/app/utils/config.js | 6 +++++- ambari-web/test/utils/config_test.js | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index b3ec9ad..8c05a9a 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -938,15 +938,18 @@ App.config = Em.Object.create({ */ textareaIntoFileConfigs: function (configs, filename) { var configsTextarea = configs.findProperty('name', 'capacity-scheduler'); + var stackConfigs = App.configsCollection.getAll(); if (configsTextarea && !App.get('testMode')) { var properties = configsTextarea.get('value').split('\n'); properties.forEach(function (_property) { - var name, value; + var name, value, isUserProperty; if (_property) { _property = _property.split(/=(.+)/); name = _property[0]; value = (_property[1]) ? _property[1] : ""; + isUserProperty = !stackConfigs.filterProperty('filename', 'capacity-scheduler.xml').findProperty('name', name); + configs.push(Em.Object.create({ name: name, value: value, @@ -956,6 +959,7 @@ App.config = Em.Object.create({ isFinal: configsTextarea.get('isFinal'), isNotDefaultValue: configsTextarea.get('isNotDefaultValue'), isRequiredByAgent: configsTextarea.get('isRequiredByAgent'), + isUserProperty: isUserProperty, group: null })); } diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js index 2c7baf9..e242476 100644 --- a/ambari-web/test/utils/config_test.js +++ b/ambari-web/test/utils/config_test.js @@ -574,6 +574,18 @@ describe('App.config', function() { describe('#textareaIntoFileConfigs', function () { var res, cs; beforeEach(function () { + var stackConfigs = [ + Em.Object.create({ + name: 'n1', + value: 'v1', + savedValue: 'v1', + serviceName: 'YARN', + filename: 'capacity-scheduler.xml', + isFinal: true, + group: null + }) + ]; + sinon.stub(App.configsCollection, 'getAll').returns(stackConfigs); res = [ Em.Object.create({ name: 'n1', @@ -582,6 +594,7 @@ describe('App.config', function() { serviceName: 'YARN', filename: 'capacity-scheduler.xml', isFinal: true, + isUserProperty: false, group: null }), Em.Object.create({ @@ -591,6 +604,7 @@ describe('App.config', function() { serviceName: 'YARN', filename: 'capacity-scheduler.xml', isFinal: true, + isUserProperty: true, group: null }) ]; @@ -611,6 +625,10 @@ describe('App.config', function() { }); }); + afterEach(function () { + App.configsCollection.getAll.restore(); + }); + it('generate capacity scheduler', function () { expect(App.config.textareaIntoFileConfigs([cs], 'capacity-scheduler.xml')).to.eql(res); });