You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/01/22 17:03:07 UTC
ambari git commit: AMBARI-9267 Versions: missing string on Hosts page
and service versions incorrect. (ababiichuk)
Repository: ambari
Updated Branches:
refs/heads/trunk 6a552002d -> 3ba23d27c
AMBARI-9267 Versions: missing string on Hosts page and service versions incorrect. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3ba23d27
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3ba23d27
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3ba23d27
Branch: refs/heads/trunk
Commit: 3ba23d27c0aa284087a910e21928f119fc3d4228
Parents: 6a55200
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Jan 22 17:32:29 2015 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Jan 22 17:32:59 2015 +0200
----------------------------------------------------------------------
ambari-web/app/assets/test/tests.js | 2 +-
ambari-web/app/messages.js | 2 +
ambari-web/app/models/host.js | 3 +-
ambari-web/app/models/host_stack_version.js | 8 ++--
.../main/admin/stack_upgrade/services.hbs | 2 +-
.../kerberos/kerberos_wizard_controler_test.js | 40 ++++++++++++++++++++
.../kerberos/kerberos_wizard_controler_tets.js | 40 --------------------
.../test/models/host_stack_version_test.js | 20 ++++++++--
8 files changed, 67 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index d02a375..ccfffe3 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -50,7 +50,7 @@ var files = ['test/init_model_test',
'test/controllers/main/alerts/add_alert_definition/step1_controller_test',
'test/controllers/main/alerts/manage_alert_notifications_controller_test',
'test/controllers/main/admin/kerberos_test',
- 'test/controllers/main/admin/kerberos/kerberos_wizard_controler_tets',
+ 'test/controllers/main/admin/kerberos/kerberos_wizard_controler_test',
'test/controllers/main/admin/kerberos/step4_controller_test',
'test/controllers/main/admin/stack_and_upgrade_controller_test',
'test/controllers/main/admin/serviceAccounts_controller_test',
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 548bb4c..0e41150 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1989,6 +1989,8 @@ Em.I18n.translations = {
'hosts.host.stackVersions.status.installing': 'Installing',
'hosts.host.stackVersions.status.current': 'Current',
'hosts.host.stackVersions.status.out_of_sync': 'Out of sync',
+ 'hosts.host.stackVersions.status.upgrading': 'Upgrading',
+ 'hosts.host.stackVersions.status.upgrade_failed': 'Upgrade Failed',
'hosts.host.metrics.dataUnavailable':'Data Unavailable',
'hosts.host.metrics.cpu':'CPU Usage',
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/models/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js
index 6fcc692..1f3f6d4 100644
--- a/ambari-web/app/models/host.js
+++ b/ambari-web/app/models/host.js
@@ -60,7 +60,8 @@ App.Host = DS.Model.extend({
isRequested: DS.attr('boolean'),
currentVersion: function () {
- return this.get('stackVersions').findProperty('isCurrent').get('repoVersion');
+ var current = this.get('stackVersions').findProperty('isCurrent');
+ return current ? current.get('repoVersion') : null;
}.property('stackVersions.@each.isCurrent'),
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/models/host_stack_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_stack_version.js b/ambari-web/app/models/host_stack_version.js
index 4c9438f..a5817d3 100644
--- a/ambari-web/app/models/host_stack_version.js
+++ b/ambari-web/app/models/host_stack_version.js
@@ -53,7 +53,9 @@ App.HostStackVersion.statusDefinition = [
"INSTALLING",
"INSTALL_FAILED",
"OUT_OF_SYNC",
- "CURRENT"
+ "CURRENT",
+ "UPGRADING",
+ "UPGRADE_FAILED"
];
/**
@@ -62,7 +64,7 @@ App.HostStackVersion.statusDefinition = [
* @return {string}
*/
App.HostStackVersion.formatStatus = function (status) {
- return status ?
+ return App.HostStackVersion.statusDefinition.contains(status) ?
Em.I18n.t('hosts.host.stackVersions.status.' + status.toLowerCase()) :
- Em.I18n.t('common.unknown');
+ status.toCapital();
};
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/templates/main/admin/stack_upgrade/services.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/services.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/services.hbs
index ed9d3fe..80cf302 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/services.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/services.hbs
@@ -30,7 +30,7 @@
{{#each service in view.services}}
<tr>
<td class="service-display-name">{{service.displayName}}</td>
- <td class="service-stack-version">{{service.stackVersion}}</td>
+ <td class="service-stack-version">{{service.serviceVersion}}</td>
<td class="stack-version-state">
{{#if service.isInstalled}}
<span class="label label-success">{{t common.installed}}</span>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_test.js b/ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_test.js
new file mode 100644
index 0000000..4db54cb
--- /dev/null
+++ b/ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_test.js
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+describe('App.KerberosWizardController', function() {
+ var controller = App.KerberosWizardController.create({});
+
+ describe('#warnBeforeExitPopup()', function () {
+ beforeEach(function () {
+ sinon.stub(App, "showConfirmationPopup", Em.K);
+ });
+ afterEach(function () {
+ App.showConfirmationPopup.restore();
+ });
+ it('should open confirmation popup', function () {
+ var f = Em.K;
+ var popup = controller.warnBeforeExitPopup(f);
+ expect(App.showConfirmationPopup.calledWith(f, Em.I18n.t('admin.kerberos.wizard.exit.msg'), null, null, Em.I18n.t('common.exitAnyway'))).to.be.true;
+ });
+ });
+
+});
+
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_tets.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_tets.js b/ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_tets.js
deleted file mode 100644
index 4db54cb..0000000
--- a/ambari-web/test/controllers/main/admin/kerberos/kerberos_wizard_controler_tets.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-describe('App.KerberosWizardController', function() {
- var controller = App.KerberosWizardController.create({});
-
- describe('#warnBeforeExitPopup()', function () {
- beforeEach(function () {
- sinon.stub(App, "showConfirmationPopup", Em.K);
- });
- afterEach(function () {
- App.showConfirmationPopup.restore();
- });
- it('should open confirmation popup', function () {
- var f = Em.K;
- var popup = controller.warnBeforeExitPopup(f);
- expect(App.showConfirmationPopup.calledWith(f, Em.I18n.t('admin.kerberos.wizard.exit.msg'), null, null, Em.I18n.t('common.exitAnyway'))).to.be.true;
- });
- });
-
-});
-
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/test/models/host_stack_version_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/host_stack_version_test.js b/ambari-web/test/models/host_stack_version_test.js
index be8ed03..3086db9 100644
--- a/ambari-web/test/models/host_stack_version_test.js
+++ b/ambari-web/test/models/host_stack_version_test.js
@@ -25,8 +25,8 @@ describe('App.HostStackVersion', function () {
describe("#displayStatus", function () {
var testCases = [
{
- status: 'INIT',
- result: Em.I18n.t('hosts.host.stackVersions.status.init')
+ status: 'OUT_OF_SYNC',
+ result: Em.I18n.t('hosts.host.stackVersions.status.out_of_sync')
},
{
status: 'INSTALLED',
@@ -41,8 +41,20 @@ describe('App.HostStackVersion', function () {
result: Em.I18n.t('hosts.host.stackVersions.status.install_failed')
},
{
- status: '',
- result: Em.I18n.t('common.unknown')
+ status: 'UPGRADE_FAILED',
+ result: Em.I18n.t('hosts.host.stackVersions.status.upgrade_failed')
+ },
+ {
+ status: 'UPGRADING',
+ result: Em.I18n.t('hosts.host.stackVersions.status.upgrading')
+ },
+ {
+ status: 'CURRENT',
+ result: Em.I18n.t('hosts.host.stackVersions.status.current')
+ },
+ {
+ status: 'ANY',
+ result: 'Any'
}
];
afterEach(function () {