Repository: ambari Updated Branches: refs/heads/branch-2.5 187cded16 -> 9c72e4457
AMBARI-20516 create table failing with HiveAccessControlException (FE part). (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9c72e445 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9c72e445 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9c72e445 Branch: refs/heads/branch-2.5 Commit: 9c72e445793e0acbbd14709461d60023e00f66cc Parents: 187cded Author: ababiichuk <[email protected]> Authored: Tue Mar 21 13:06:59 2017 +0200 Committer: ababiichuk <[email protected]> Committed: Tue Mar 21 13:06:59 2017 +0200 ---------------------------------------------------------------------- .../wizard/step7/assign_master_controller.js | 9 ++++++- .../step7/assign_master_controller_test.js | 28 +++++++++++++++----- 2 files changed, 30 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9c72e445/ambari-web/app/controllers/wizard/step7/assign_master_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js index 326f571..580b761 100644 --- a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js +++ b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js @@ -390,6 +390,8 @@ App.AssignMasterOnStep7Controller = Em.Controller.extend(App.BlueprintMixin, App context.toggleProperty('controller.forceUpdateBoundaries'); var configActionComponent = self.get('configActionComponent'); var componentHostName = self.getSelectedHostName(configActionComponent.componentName); + var config = self.get('configWidgetContext.config'); + var oldValueKey = context.get('controller.wizardController.name') === 'installerController' ? 'initialValue' : 'savedValue'; if (self.get('content.controllerName')) { self.saveMasterComponentHosts(); self.saveRecommendationsHostGroups(); @@ -399,7 +401,12 @@ App.AssignMasterOnStep7Controller = Em.Controller.extend(App.BlueprintMixin, App } configActionComponent.hostName = componentHostName; - self.get('configWidgetContext.config').set('configActionComponent', configActionComponent); + config.set('configActionComponent', configActionComponent); + context.get('controller').loadConfigRecommendations([{ + type: App.config.getConfigTagFromFileName(config.get('fileName')), + name: config.get('name'), + old_value: config.get(oldValueKey) + }]); }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/9c72e445/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js b/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js index 0810c0d..0f3c599 100644 --- a/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js +++ b/ambari-web/test/controllers/wizard/step7/assign_master_controller_test.js @@ -340,6 +340,9 @@ describe('App.AssignMasterOnStep7Controller', function () { sinon.stub(mock, 'loadMasterComponentHosts'); sinon.stub(mock, 'setDBProperty'); sinon.stub(mock, 'loadConfigRecommendations'); + sinon.stub(App.config, 'getConfigTagFromFileName', function (value) { + return value; + }); view.reopen({ content: Em.Object.create({ controllerName: 'ctrl1', @@ -357,16 +360,16 @@ describe('App.AssignMasterOnStep7Controller', function () { }, configWidgetContext: Em.Object.create({ config: Em.Object.create({ - configAction: { - hostComponentConfig: { - fileName: 'file1', - configName: 'conf1' - } - }, + fileName: 'file1', + name: 'conf1', serviceName: 'S1', + savedValue: 'val1', toggleProperty: Em.K }), controller: Em.Object.create({ + wizardController: { + name: 'ctrl' + }, stepConfigs: [ Em.Object.create({ serviceName: 'S1', @@ -389,6 +392,7 @@ describe('App.AssignMasterOnStep7Controller', function () { mock.loadMasterComponentHosts.restore(); mock.setDBProperty.restore(); mock.loadConfigRecommendations.restore(); + App.config.getConfigTagFromFileName.restore(); }); it("saveMasterComponentHosts should be called", function() { @@ -405,5 +409,17 @@ describe('App.AssignMasterOnStep7Controller', function () { hostName: 'host1' }); }); + + it("loadConfigRecommendations should be called once", function () { + expect(mock.loadConfigRecommendations.calledOnce).to.be.true; + }); + + it("loadConfigRecommendations should be called with correct arguments", function () { + expect(mock.loadConfigRecommendations.calledWith([{ + type: 'file1', + name: 'conf1', + old_value: 'val1' + }])).to.be.true; + }); }); }); \ No newline at end of file
