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/09/02 14:42:54 UTC
ambari git commit: AMBARI-12973 Web Client Should Warn On Host
Version Mismatch For Maintenance Mode. (ababiichuk)
Repository: ambari
Updated Branches:
refs/heads/branch-2.1 56885a593 -> bb1473df4
AMBARI-12973 Web Client Should Warn On Host Version Mismatch For Maintenance Mode. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bb1473df
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bb1473df
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bb1473df
Branch: refs/heads/branch-2.1
Commit: bb1473df49174838b48331a601a1cfd4a1255407
Parents: 56885a5
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Sep 2 15:40:59 2015 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Sep 2 15:40:59 2015 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 14 ++++++++++---
ambari-web/app/messages.js | 2 ++
ambari-web/app/models/stack_version/version.js | 6 +++++-
ambari-web/app/views/main/host.js | 21 +++++++++++++++++++-
4 files changed, 38 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/bb1473df/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index f3e1489..3cc4de7 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -1826,11 +1826,19 @@ App.MainHostDetailsController = Em.Controller.extend({
var state = context.active ? 'ON' : 'OFF';
var self = this;
var message = Em.I18n.t('hosts.host.details.for.postfix').format(context.label);
+ var popupInfo = Em.I18n.t('hosts.passiveMode.popup').format(context.active ? 'On' : 'Off', this.get('content.hostName'));
+ if (state === 'OFF') {
+ var hostVersion = this.get('content.stackVersions') && this.get('content.stackVersions').findProperty('isCurrent').get('repoVersion'),
+ currentVersion = App.StackVersion.find().findProperty('isCurrent'),
+ clusterVersion = currentVersion && currentVersion.get('repositoryVersion.repositoryVersion');
+ if (hostVersion !== clusterVersion) {
+ var msg = Em.I18n.t("hosts.passiveMode.popup.version.mismatch").format(this.get('content.hostName'), clusterVersion);
+ popupInfo += '<br/><div class="alert alert-warning">' + msg + '</div>';
+ }
+ }
return App.showConfirmationPopup(function () {
self.hostPassiveModeRequest(state, message);
- },
- Em.I18n.t('hosts.passiveMode.popup').format(context.active ? 'On' : 'Off', this.get('content.hostName'))
- );
+ }, popupInfo);
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/bb1473df/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 35f72c7..119b1db 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2308,6 +2308,8 @@ Em.I18n.translations = {
'hosts.add.exit.body':'Do you really want to exit Add Host Wizard?',
'hosts.assignRack':'Assign Rack',
'hosts.passiveMode.popup':'Are you sure you want to <b>Turn {0} Maintenance Mode</b> for {1}?',
+ 'hosts.passiveMode.popup.version.mismatch': '{0} has components from a stack which is not current. Before bringing this host out of maintenance mode, it is recommended that you upgrade its components to {1}',
+ 'hosts.passiveMode.popup.version.mismatch.multiple': 'Some hosts have components from a stack which is not current. Before bringing these hosts out of maintenance mode, it is recommended that you upgrade their components to {0}',
'charts.horizon.chart.showText':'show',
'charts.horizon.chart.hideText':'hide',
http://git-wip-us.apache.org/repos/asf/ambari/blob/bb1473df/ambari-web/app/models/stack_version/version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_version/version.js b/ambari-web/app/models/stack_version/version.js
index fdc8755..7fd4134 100644
--- a/ambari-web/app/models/stack_version/version.js
+++ b/ambari-web/app/models/stack_version/version.js
@@ -47,7 +47,11 @@ App.StackVersion = DS.Model.extend({
noInitHosts: function() {
return this.get('notInstalledHosts.length') == 0;
- }.property('notInstalledHosts.length')
+ }.property('notInstalledHosts.length'),
+
+ isCurrent: function() {
+ return this.get('state') === 'CURRENT';
+ }.property('state')
});
App.StackVersion.FIXTURES = [];
http://git-wip-us.apache.org/repos/asf/ambari/blob/bb1473df/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index a0f1a0c..f63870f 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -435,6 +435,15 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
});
}
var hostNamesSkipped = hostsToSkip.mapProperty('hostName');
+ if (operationData.action === 'PASSIVE_STATE') {
+ hostNamesSkipped = [];
+ var outOfSyncHosts = App.StackVersion.find().findProperty('isCurrent').get('outOfSyncHosts');
+ for (var i = 0; i < outOfSyncHosts.length; i++) {
+ if (hostNames.contains(outOfSyncHosts[i])) {
+ hostNamesSkipped.push(outOfSyncHosts[i]);
+ }
+ }
+ }
var message;
if (operationData.componentNameFormatted) {
message = Em.I18n.t('hosts.bulkOperation.confirmation.hostComponents').format(operationData.message, operationData.componentNameFormatted, hostNames.length);
@@ -474,7 +483,17 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
bodyClass: Em.View.extend({
templateName: require('templates/main/host/bulk_operation_confirm_popup'),
message: message,
- warningInfo: Em.I18n.t('hosts.bulkOperation.warningInfo.body'),
+ warningInfo: function() {
+ switch (operationData.action) {
+ case "DECOMMISSION":
+ return Em.I18n.t('hosts.bulkOperation.warningInfo.body');
+ case "PASSIVE_STATE":
+ return operationData.state === 'OFF' ? Em.I18n.t('hosts.passiveMode.popup.version.mismatch.multiple')
+ .format(App.StackVersion.find().findProperty('isCurrent').get('repositoryVersion.repositoryVersion')) : "";
+ default:
+ return ""
+ }
+ }.property(),
textareaVisible: false,
textTrigger: function() {
this.set('textareaVisible', !this.get('textareaVisible'));