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/06/16 23:54:25 UTC

[1/2] ambari git commit: AMBARI-11962. Some added properties changing during deploy (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 1cdf8864c -> 0930a74fc


AMBARI-11962. Some added properties changing during deploy (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 0930a74fc54ac21e67c2a912de9618bcb2e65169
Parents: 5c47a61
Author: Alex Antonenko <hi...@gmail.com>
Authored: Tue Jun 16 23:48:19 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Jun 17 00:53:55 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/wizard/step8_controller.js | 13 +++++++++++--
 ambari-web/test/controllers/wizard/step8_test.js      | 11 +++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0930a74f/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index b44f900..c167f68 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -384,13 +384,22 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
     var dependentConfig = $.extend(true, [], configMapping.filterProperty('foreignKey'));
     dependentConfig.forEach(function (_config) {
       App.config.setConfigValue(uiConfig, this.get('content.serviceConfigProperties'), _config);
-      if(!_config.noMatchSoSkipThisConfig)
+      // generated config name using template for example `hadoop.proxyuser.hive.hosts`
+      var configName = _config._name || _config.name;
+      // property from <code>content.serviceConfigProperties</code>. This property can be added in custom-site.xml
+      // with the same name as propety from defined config mapping. In this case property from config mapping
+      // object should be ignored.
+      var isPropertyDefined = this.get('content.serviceConfigProperties')
+            .filterProperty('filename', _config.filename).someProperty('name', configName);
+      // ignore config mapping property if no matches for template was found or property already added by user
+      if(!_config.noMatchSoSkipThisConfig && !isPropertyDefined) {
         uiConfig.pushObject({
           "id": "site property",
-          "name": _config._name || _config.name,
+          "name": configName,
           "value": _config.value,
           "filename": _config.filename
         });
+      }
     }, this);
     return uiConfig;
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/0930a74f/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index 67eb04a..a869663 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -1765,9 +1765,13 @@ describe('App.WizardStep8Controller', function () {
   describe('#loadUiSideConfigs', function() {
     beforeEach(function() {
       sinon.stub(App.config, 'setConfigValue', Em.K);
+      sinon.stub(installerStep8Controller, 'get').withArgs('content.serviceConfigProperties').returns([
+        { name: 'c9', filename: 'f3'}
+      ]);
     });
     afterEach(function() {
       App.config.setConfigValue.restore();
+      installerStep8Controller.get.restore();
     });
 
     it('configs with foreignKey', function() {
@@ -1775,10 +1779,13 @@ describe('App.WizardStep8Controller', function () {
         {foreignKey: 'fk1', templateName: 't5', value: 'v5', name: 'c5', filename: 'f1'},
         {foreignKey: 'fk2', templateName: 't6', value: 'v6', name: 'c6', filename: 'f1'},
         {foreignKey: 'fk3', templateName: 't7', value: 'v7', name: 'c7', filename: 'f2'},
-        {foreignKey: 'fk4', templateName: 't8', value: 'v8', name: 'c8', filename: 'f2'}
+        {foreignKey: 'fk4', templateName: 't8', value: 'v8', name: 'c8', filename: 'f2'},
+        {foreignKey: 'fk5', templateName: 't9', value: 'v9', name: 'c9', filename: 'f3'}
       ];
       var uiConfigs = installerStep8Controller.loadUiSideConfigs(configMapping);
-      expect(uiConfigs.length).to.equal(configMapping.length);
+      // should ignore one config that was saved in contentServiceConfigProperties
+      expect(uiConfigs.length).to.equal(configMapping.length - 1);
+      expect(uiConfigs.findProperty('name', 'c9')).to.be.undefined;
       expect(uiConfigs.everyProperty('id', 'site property')).to.be.true;
       uiConfigs.forEach(function(c, index) {
         if (Em.isNone(configMapping[index].foreignKey))


[2/2] ambari git commit: AMBARI-11944. Service Accts names are not correct on add service (alexantonenko)

Posted by al...@apache.org.
AMBARI-11944. Service Accts names are not correct on add service (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 5c47a61f390fe0ea565b3ab9b3303f4ed984b592
Parents: 1cdf886
Author: Alex Antonenko <hi...@gmail.com>
Authored: Tue Jun 16 15:29:19 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Jun 17 00:53:55 2015 +0300

----------------------------------------------------------------------
 .../controllers/main/admin/serviceAccounts_controller.js    | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5c47a61f/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
index e4f1918..1b1b674 100644
--- a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
+++ b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
@@ -81,6 +81,15 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
 
     miscConfigs = App.config.miscConfigVisibleProperty(miscConfigs, App.Service.find().mapProperty('serviceName').concat('MISC'));
 
+    // load specific users along the wizards which called <code>loadUsers</code> method
+    var wizardContentProperties = [
+      {key: 'group', configName: 'user_group'},
+      {key: 'smokeuser', configName: 'smokeuser'},
+      {key: 'hdfsUser', configName: 'hdfs_user'}
+    ];
+    wizardContentProperties.forEach(function(item) {
+      this.setContentProperty(item.key, item.configName, miscConfigs);
+    }, this);
     this.set('users', miscConfigs.filterProperty('isVisible'));
     this.set('dataIsLoaded', true);
   },