Repository: ambari
Updated Branches:
  refs/heads/trunk 917c79151 -> 6c540fd07


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/6c540fd0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6c540fd0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6c540fd0

Branch: refs/heads/trunk
Commit: 6c540fd0720d2702e3572a20501eea3bcc941e47
Parents: 917c791
Author: ababiichuk <[email protected]>
Authored: Tue Mar 21 13:01:16 2017 +0200
Committer: ababiichuk <[email protected]>
Committed: Tue Mar 21 13:01:16 2017 +0200

----------------------------------------------------------------------
 .../wizard/step7/assign_master_controller.js    | 12 ++++++-
 .../step7/assign_master_controller_test.js      | 33 +++++++++++++++-----
 2 files changed, 37 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6c540fd0/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 e635f41..38e3b27 100644
--- a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
+++ b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
@@ -118,6 +118,9 @@ App.AssignMasterOnStep7Controller = 
Em.Controller.extend(App.BlueprintMixin, App
         controller: self
       }),
       primary: Em.I18n.t('common.select'),
+      onPrimary: function () {
+        self.submit();
+      },
       onSecondary: function() {
         this.showWarningPopup();
       },
@@ -393,6 +396,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();
@@ -402,7 +407,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)
+      }]);
     });
   }
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c540fd0/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 7705fb0..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
@@ -325,7 +325,8 @@ describe('App.AssignMasterOnStep7Controller', function () {
       mock = {
         saveMasterComponentHosts: Em.K,
         loadMasterComponentHosts: Em.K,
-        setDBProperty: Em.K
+        setDBProperty: Em.K,
+        loadConfigRecommendations: Em.K
       },
       config = Em.Object.create({
         filename: 'file1',
@@ -338,6 +339,10 @@ describe('App.AssignMasterOnStep7Controller', function () {
       sinon.stub(mock, 'saveMasterComponentHosts');
       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',
@@ -355,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',
@@ -386,6 +391,8 @@ describe('App.AssignMasterOnStep7Controller', function () {
       mock.saveMasterComponentHosts.restore();
       mock.loadMasterComponentHosts.restore();
       mock.setDBProperty.restore();
+      mock.loadConfigRecommendations.restore();
+      App.config.getConfigTagFromFileName.restore();
     });
 
     it("saveMasterComponentHosts should be called", function() {
@@ -402,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

Reply via email to