You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2015/03/12 18:27:45 UTC
ambari git commit: AMBARI-10042. No request info is loaded on step 6
of Enable Kerberos Wizard. (akovalenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 223a65cc1 -> 4530322bd
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/4530322b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4530322b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4530322b
Branch: refs/heads/trunk
Commit: 4530322bdd65889ac55c2e39fb314ff8d00b4701
Parents: 223a65c
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Thu Mar 12 16:58:40 2015 +0200
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Thu Mar 12 19:27:20 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/4530322b/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/4530322b/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 d3adc2a..7f3b3b3 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/4530322b/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);
+ });
+ });
+
+ });
+
});