Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 148C117994 for ; Thu, 12 Mar 2015 17:36:18 +0000 (UTC) Received: (qmail 33840 invoked by uid 500); 12 Mar 2015 17:36:17 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 33810 invoked by uid 500); 12 Mar 2015 17:36:17 -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 33800 invoked by uid 99); 12 Mar 2015 17:36:17 -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, 12 Mar 2015 17:36:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AD524E18E7; Thu, 12 Mar 2015 17:36:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akovalenko@apache.org To: commits@ambari.apache.org Message-Id: <75144c597e5e448da5610b0ec3e361df@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-10042. No request info is loaded on step 6 of Enable Kerberos Wizard. (akovalenko) Date: Thu, 12 Mar 2015 17:36:17 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/branch-2.0.0 b7a1e7174 -> 50217684b AMBARI-10042. No request info is loaded on step 6 of Enable Kerberos Wizard. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/50217684 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/50217684 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/50217684 Branch: refs/heads/branch-2.0.0 Commit: 50217684b6063c72a8c378756d53417e2a745b27 Parents: b7a1e71 Author: Aleksandr Kovalenko Authored: Thu Mar 12 16:58:40 2015 +0200 Committer: Aleksandr Kovalenko Committed: Thu Mar 12 19:33:09 2015 +0200 ---------------------------------------------------------------------- .../progress_popup_controller.js | 3 ++ ambari-web/app/utils/ajax/ajax.js | 2 +- .../progress_popup_controller_test.js | 46 ++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/50217684/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js index 3441723..c723bf1 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_popup_controller.js @@ -109,6 +109,9 @@ App.HighAvailabilityProgressPopupController = Ember.Controller.extend({ var name = 'background_operations.get_by_request'; if (!Em.isNone(stageId)) { name = 'common.request.polling'; + if (stageId === 0) { + stageId = '0'; + } } requestIds.forEach(function (requestId) { App.ajax.send({ http://git-wip-us.apache.org/repos/asf/ambari/blob/50217684/ambari-web/app/utils/ajax/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js index 2804308..4081c2a 100644 --- a/ambari-web/app/utils/ajax/ajax.js +++ b/ambari-web/app/utils/ajax/ajax.js @@ -187,7 +187,7 @@ var urls = { }, 'common.request.polling': { - 'real': '/clusters/{clusterName}/requests/{requestId}?fields=tasks/Tasks/request_id,tasks/Tasks/command,tasks/Tasks/command_detail,tasks/Tasks/start_time,tasks/Tasks/end_time,tasks/Tasks/exit_code,Requests/*&tasks/Tasks/stage_id={stageId}', + 'real': '/clusters/{clusterName}/requests/{requestId}?fields=tasks/Tasks/request_id,tasks/Tasks/command,tasks/Tasks/command_detail,tasks/Tasks/start_time,tasks/Tasks/end_time,tasks/Tasks/exit_code,tasks/Tasks/host_name,tasks/Tasks/id,tasks/Tasks/role,tasks/Tasks/status,tasks/Tasks/structured_out,Requests/*&tasks/Tasks/stage_id={stageId}', 'mock': '/data/background_operations/host_upgrade_tasks.json' }, http://git-wip-us.apache.org/repos/asf/ambari/blob/50217684/ambari-web/test/controllers/main/admin/highAvailability/progress_popup_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/admin/highAvailability/progress_popup_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability/progress_popup_controller_test.js index c6ec583..95512e9 100644 --- a/ambari-web/test/controllers/main/admin/highAvailability/progress_popup_controller_test.js +++ b/ambari-web/test/controllers/main/admin/highAvailability/progress_popup_controller_test.js @@ -137,4 +137,50 @@ describe('App.HighAvailabilityProgressPopupController', function () { }); + describe('#getHosts', function () { + + var cases = [ + { + name: 'background_operations.get_by_request', + title: 'default background operation polling' + }, + { + stageId: 0, + name: 'common.request.polling', + stageIdPassed: '0', + title: 'polling by stage, stageId = 0' + }, + { + stageId: 1, + name: 'common.request.polling', + stageIdPassed: 1, + title: 'polling by stage' + } + ]; + + beforeEach(function () { + sinon.stub(App.ajax, 'send', Em.K); + }); + + afterEach(function () { + App.ajax.send.restore(); + }); + + cases.forEach(function (item) { + it(item.title, function () { + controller.setProperties({ + requestIds: [1, 2], + stageId: item.stageId + }); + controller.getHosts(); + expect(App.ajax.send.calledTwice).to.be.true; + expect(App.ajax.send.firstCall.args[0].name).to.equal(item.name); + expect(App.ajax.send.secondCall.args[0].name).to.equal(item.name); + expect(App.ajax.send.firstCall.args[0].data.stageId).to.eql(item.stageIdPassed); + expect(App.ajax.send.secondCall.args[0].data.stageId).to.eql(item.stageIdPassed); + }); + }); + + }); + });