You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2018/07/03 05:35:34 UTC

[ambari] branch trunk updated: AMBARI-24237. UI Install: Custom Yarn Capacity Scheduler property set is missing after deploy. (jaimin) (#1665)

This is an automated email from the ASF dual-hosted git repository.

jaimin pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8a30716  AMBARI-24237. UI Install: Custom Yarn Capacity Scheduler property set is missing after deploy. (jaimin) (#1665)
8a30716 is described below

commit 8a3071654659bf16f47d558fc9ebe0e9b9133d90
Author: Jetly <ja...@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);
     });