Repository: ambari Updated Branches: refs/heads/branch-2.4 aa35b198e -> 4146ab9ce
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/4146ab9c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4146ab9c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4146ab9c Branch: refs/heads/branch-2.4 Commit: 4146ab9ce589fb4891c82da57f6f74420af67bac Parents: aa35b19 Author: Jaimin Jetly <[email protected]> Authored: Wed Nov 9 18:53:41 2016 -0800 Committer: Jaimin Jetly <[email protected]> Committed: Wed Nov 9 18:53:41 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/4146ab9c/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/4146ab9c/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();
