You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2015/12/10 22:33:54 UTC
ambari git commit: Revert "AMBARI-14168. Tolerate null hostname for a
AMBARI_SERVER_ACTION with no hostname for task.(xiwang)"
Repository: ambari
Updated Branches:
refs/heads/trunk 27f2b09e8 -> ccc3d2d7c
Revert "AMBARI-14168. Tolerate null hostname for a AMBARI_SERVER_ACTION with no hostname for task.(xiwang)"
This reverts commit 66e1a3a5b34a888e76a101a87b5deda71d0aaeac.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ccc3d2d7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ccc3d2d7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ccc3d2d7
Branch: refs/heads/trunk
Commit: ccc3d2d7c0fc14a5719a3ac96902c69e510ef7ce
Parents: 27f2b09
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu Dec 10 13:33:45 2015 -0800
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Thu Dec 10 13:33:45 2015 -0800
----------------------------------------------------------------------
ambari-web/app/messages.js | 2 -
ambari-web/app/utils/host_progress_popup.js | 24 +-------
.../common/host_progress_popup_body_view.js | 2 +-
.../test/utils/host_progress_popup_test.js | 62 +++++---------------
4 files changed, 18 insertions(+), 72 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ccc3d2d7/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index ed1f3c6..8ab24d4 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -331,8 +331,6 @@ Em.I18n.translations = {
'hostPopup.noServicesToShow':'No services to show',
'hostPopup.noHostsToShow':'No hosts to show',
'hostPopup.noTasksToShow':'No tasks to show',
- 'hostPopup.Tasks.role.ambariServerAction':'AMBARI_SERVER_ACTION',
- 'hostPopup.Hosts.ambariServerHost':'Ambari Server Host',
'hostPopup.status.category.all':'All ({0})',
'hostPopup.status.category.pending':'Pending ({0})',
'hostPopup.status.category.inProgress':'In Progress ({0})',
http://git-wip-us.apache.org/repos/asf/ambari/blob/ccc3d2d7/ambari-web/app/utils/host_progress_popup.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/host_progress_popup.js b/ambari-web/app/utils/host_progress_popup.js
index ce88db8..726a96a 100644
--- a/ambari-web/app/utils/host_progress_popup.js
+++ b/ambari-web/app/utils/host_progress_popup.js
@@ -632,24 +632,6 @@ App.HostPopup = Em.Object.create({
},
/**
- * Get hostname to display: return "n/a" for safety measure if hostname is null
- * return "Ambari Server Host" if task role is AMBARI_SERVER_ACTION
- * @param {Array} tasks
- * @param {String} hostname
- * @return {String} hostname to display
- */
- getDisplayHostname: function (hostname, tasks) {
- if ((!hostname || hostname == "null") && tasks.someProperty('Tasks.role', Em.I18n.t('hostPopup.Tasks.role.ambariServerAction'))) {
- // change hostname to "ambari server host"
- return Em.I18n.t('hostPopup.Hosts.ambariServerHost');
- } else if ((!hostname || hostname == "null")){
- // just for safety measure
- return Em.I18n.t('common.na');
- }
- return hostname;
- },
-
- /**
*
* @param {object} hostsMap
* @returns {wrappedHost[]}
@@ -668,12 +650,8 @@ App.HostPopup = Em.Object.create({
var hostInfo = Em.Object.create({
name: hostName,
publicName: _host.publicName,
- publicNameDisplay: function () {
- return self.getDisplayHostname(this.get('publicName'), tasks);
- }.property('publicName'),
displayName: function () {
- var name = self.getDisplayHostname(this.get('name'), tasks);
- return name.length < 43 ? name : (name.substr(0, 40) + '...');
+ return this.get('name').length < 43 ? this.get('name') : (this.get('name').substr(0, 40) + '...');
}.property('name'),
progress: 0,
status: App.format.taskStatus("PENDING"),
http://git-wip-us.apache.org/repos/asf/ambari/blob/ccc3d2d7/ambari-web/app/views/common/host_progress_popup_body_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/host_progress_popup_body_view.js b/ambari-web/app/views/common/host_progress_popup_body_view.js
index 2f78f03..cdabc5e 100644
--- a/ambari-web/app/views/common/host_progress_popup_body_view.js
+++ b/ambari-web/app/views/common/host_progress_popup_body_view.js
@@ -643,7 +643,7 @@ App.HostProgressPopupBodyView = App.TableView.extend({
tasksInfo.pushObject(this.get("controller").createTask(_task));
}, this);
if (tasksInfo.length) {
- this.get("controller").set("popupHeaderName", event.context.get('publicNameDisplay'));
+ this.get("controller").set("popupHeaderName", event.context.publicName);
this.get("controller").set("currentHostName", event.context.publicName);
}
this.switchLevel("TASKS_LIST");
http://git-wip-us.apache.org/repos/asf/ambari/blob/ccc3d2d7/ambari-web/test/utils/host_progress_popup_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/host_progress_popup_test.js b/ambari-web/test/utils/host_progress_popup_test.js
index b93fc34..1b7efb3 100644
--- a/ambari-web/test/utils/host_progress_popup_test.js
+++ b/ambari-web/test/utils/host_progress_popup_test.js
@@ -101,63 +101,53 @@ describe('App.HostPopup', function () {
{
Tasks: {
status: 'COMPLETED',
- id: 2,
- role: "NAMENODE"
+ id: 2
}
},
{
Tasks: {
status: 'COMPLETED',
- id: 3,
- role: "NAMENODE"
+ id: 3
}
},
{
Tasks: {
status: 'COMPLETED',
- id: 1,
- role: "NAMENODE"
+ id: 1
}
}
],
m: 'All COMPLETED',
r: 'SUCCESS',
p: 100,
- ids: [1,2,3],
- name: "host1",
- displayHostNameResult: "host1"
+ ids: [1,2,3]
},
{
t: [
{
Tasks: {
status: 'FAILED',
- id: 2,
- role: "NAMENODE"
+ id: 2
}
},
{
Tasks: {
status: 'COMPLETED',
- id: 1,
- role: "NAMENODE"
+ id: 1
}
}
,
{
Tasks: {
status: 'COMPLETED',
- id: 3,
- role: "NAMENODE"
+ id: 3
}
}
],
m: 'One FAILED',
r: 'FAILED',
p: 100,
- ids: [1,2,3],
- name: "",
- displayHostNameResult: "n/a"
+ ids: [1,2,3]
},
{
t: [
@@ -177,57 +167,47 @@ describe('App.HostPopup', function () {
m: 'One ABORTED',
r: 'ABORTED',
p: 100,
- ids: [1,2],
- name: null,
- displayHostNameResult: "n/a"
+ ids: [1,2]
},
{
t: [
{
Tasks: {
status: 'TIMEDOUT',
- id: 3,
- role: "NAMENODE"
+ id: 3
}
},
{
Tasks: {
status: 'COMPLETED',
- id: 1,
- role: "AMBARI_SERVER_ACTION"
+ id: 1
}
}
],
m: 'One TIMEDOUT',
r: 'TIMEDOUT',
p: 100,
- ids: [1,3],
- name: "host2",
- displayHostNameResult: "host2"
+ ids: [1,3]
},
{
t: [
{
Tasks: {
status: 'IN_PROGRESS',
- id: 1,
- role: "NAMENODE"
+ id: 1
}
},
{
Tasks: {
status: 'COMPLETED',
- id: 2,
- role: "AMBARI_SERVER_ACTION"
+ id: 2
}
}
],
m: 'One IN_PROGRESS',
r: 'IN_PROGRESS',
p: 68,
- ids: [1,2],
- name: null,
- displayHostNameResult: "Ambari Server Host"
+ ids: [1,2]
},
{
t: [
@@ -247,9 +227,7 @@ describe('App.HostPopup', function () {
m: 'Something else',
r: 'PENDING',
p: 55,
- ids: [2,3],
- name: undefined,
- displayHostNameResult: "n/a"
+ ids: [2,3]
}
];
@@ -383,14 +361,6 @@ describe('App.HostPopup', function () {
});
});
- describe('#getDisplayHostname', function() {
- test_tasks.forEach(function(test_task) {
- it(test_task.m, function() {
- expect(App.HostPopup.getDisplayHostname(test_task.name, test_task.t)).to.equal(test_task.displayHostNameResult);
- });
- });
- });
-
describe('#isAbortableByStatus', function () {
statusCases.forEach(function (item) {
it('should return ' + item.result + ' for ' + item.status, function () {