Repository: ambari Updated Branches: refs/heads/trunk a30c6a13b -> 4163bcb13
AMBARI-18766. Add Service failed when none of the host components report version. (2nd patch) (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4163bcb1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4163bcb1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4163bcb1 Branch: refs/heads/trunk Commit: 4163bcb13592119b52352d1e4fadd124b11c4267 Parents: a30c6a1 Author: Jaimin Jetly <[email protected]> Authored: Wed Nov 9 18:53:41 2016 -0800 Committer: Jaimin Jetly <[email protected]> Committed: Wed Nov 9 18:55:33 2016 -0800 ---------------------------------------------------------------------- ambari-web/app/controllers/wizard/step8_controller.js | 5 +++-- ambari-web/test/controllers/wizard/step8_test.js | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4163bcb1/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 237e2d8..24d8ec7 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -328,9 +328,10 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz * @method loadRepoInfo */ loadRepoInfo: function () { - - var currentRepoVersion = App.get('currentStackVersionNumber'); var stackName = App.get('currentStackName'); + var currentStackVersionNumber = App.get('currentStackVersionNumber'); + var currentStackVersion = App.StackVersion.find().filterProperty('stack', stackName).findProperty('version', currentStackVersionNumber); + var currentRepoVersion = currentStackVersion.get('repositoryVersion.repositoryVersion'); return App.ajax.send({ name: 'cluster.load_repo_version', http://git-wip-us.apache.org/repos/asf/ambari/blob/4163bcb1/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 3abe2cb..5efb866 100644 --- a/ambari-web/test/controllers/wizard/step8_test.js +++ b/ambari-web/test/controllers/wizard/step8_test.js @@ -639,11 +639,17 @@ describe('App.WizardStep8Controller', function () { beforeEach(function () { var stubForGet = sinon.stub(App, 'get'); stubForGet.withArgs('currentStackName').returns('HDP'); - stubForGet.withArgs('currentStackVersionNumber').returns('2.3.0.0-2208'); + stubForGet.withArgs('currentStackVersionNumber').returns('2.3'); + sinon.stub(App.StackVersion, 'find', function() { + return [ + Em.Object.create({state: 'NOT_CURRENT', stack: 'HDP', version: '2.3', repositoryVersion: {repositoryVersion: '2.3.0.0-2208'}}) + ]; + }); }); afterEach(function () { App.get.restore(); + App.StackVersion.find.restore(); }); it('should use current StackVersion', function() { installerStep8Controller.loadRepoInfo();
