ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-17879 Stack Advisor recommendation call doesn't happen after we select the host for HSI. (ababiichuk)
Date Mon, 25 Jul 2016 10:57:37 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 61c73dc0f -> c0d4dba50


AMBARI-17879 Stack Advisor recommendation call doesn't happen after we select the host for
HSI. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: c0d4dba50b2d290e44a1532d309676013e195ee4
Parents: 61c73dc
Author: ababiichuk <ababiichuk@hortonworks.com>
Authored: Mon Jul 25 13:29:20 2016 +0300
Committer: ababiichuk <ababiichuk@hortonworks.com>
Committed: Mon Jul 25 13:57:14 2016 +0300

----------------------------------------------------------------------
 .../wizard/step7/assign_master_controller.js            |  6 ++++++
 .../wizard/step7/assign_master_controller_test.js       | 12 ++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c0d4dba5/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 3e93e3b..4ea1e65 100644
--- a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
+++ b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
@@ -390,10 +390,16 @@ App.AssignMasterOnStep7Controller = Em.Controller.extend(App.BlueprintMixin,
App
       var hostComponentConfig = context.get('config.configAction.hostComponentConfig');
       var serviceConfigs = context.get('controller.stepConfigs').findProperty('serviceName',
context.get('config.serviceName')).get('configs');
       var config = serviceConfigs.filterProperty('filename', hostComponentConfig.fileName).findProperty('name',
hostComponentConfig.configName);
+      var oldValue = config.get('value');
       config.set('value', componentHostName);
       config.set('recommendedValue', componentHostName);
       configActionComponent.hostName = componentHostName;
       self.get('configWidgetContext.config').set('configActionComponent', configActionComponent);
+      context.get('controller').loadConfigRecommendations([{
+        "type": App.config.getConfigTagFromFileName(config.get('filename')),
+        "name": config.get('name'),
+        "old_value": oldValue
+      }])
     });
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0d4dba5/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 3ad3a95..14c7e20 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,7 @@ describe('App.AssignMasterOnStep7Controller', function () {
       sinon.stub(mock, 'saveMasterComponentHosts');
       sinon.stub(mock, 'loadMasterComponentHosts');
       sinon.stub(mock, 'setDBProperty');
+      sinon.stub(mock, 'loadConfigRecommendations');
       view.reopen({
         content: Em.Object.create({
           controllerName: 'ctrl1'
@@ -371,7 +373,8 @@ describe('App.AssignMasterOnStep7Controller', function () {
                   config
                 ]
               })
-            ]
+            ],
+            loadConfigRecommendations: mock.loadConfigRecommendations
           })
         })
       });
@@ -384,6 +387,7 @@ describe('App.AssignMasterOnStep7Controller', function () {
       mock.saveMasterComponentHosts.restore();
       mock.loadMasterComponentHosts.restore();
       mock.setDBProperty.restore();
+      mock.loadConfigRecommendations.restore();
     });
 
     it("saveMasterComponentHosts should be called", function() {
@@ -405,5 +409,9 @@ describe('App.AssignMasterOnStep7Controller', function () {
       expect(config.get('value')).to.be.equal('host1');
       expect(config.get('recommendedValue')).to.be.equal('host1');
     });
+
+    it("config should be set", function() {
+      expect(mock.loadConfigRecommendations.calledOnce).to.be.true;
+    });
   });
 });
\ No newline at end of file


Mime
View raw message