Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ACDCE200BCB for ; Thu, 10 Nov 2016 03:55:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AB543160AFD; Thu, 10 Nov 2016 02:55:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F343D160AFA for ; Thu, 10 Nov 2016 03:55:00 +0100 (CET) Received: (qmail 79333 invoked by uid 500); 10 Nov 2016 02:55:00 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 79323 invoked by uid 99); 10 Nov 2016 02:55:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Nov 2016 02:55:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 016BEE03E2; Thu, 10 Nov 2016 02:54:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaimin@apache.org To: commits@ambari.apache.org Message-Id: <0960abd2fecf47c7b90100c163f34576@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-18766. Add Service failed when none of the host components report version. (2nd patch) (jaimin) Date: Thu, 10 Nov 2016 02:55:00 +0000 (UTC) archived-at: Thu, 10 Nov 2016 02:55:01 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.5 e404eee44 -> 2414ce6ad 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/2414ce6a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2414ce6a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2414ce6a Branch: refs/heads/branch-2.5 Commit: 2414ce6ad3a9a515e076fdeae4e42ddc17a3e075 Parents: e404eee4 Author: Jaimin Jetly Authored: Wed Nov 9 18:53:41 2016 -0800 Committer: Jaimin Jetly Committed: Wed Nov 9 18:54:46 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/2414ce6a/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/2414ce6a/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();