Support 'require_online' flag for roles on UI

Related-bug: #1461136

Change-Id: I8ab6dc4bed1acb75d2af7c159c9c6fbca4a33c0c
This commit is contained in:
Alexandra Morozova 2015-06-02 23:11:03 +02:00 committed by Vitaly Kramskikh
parent 3830bdcb28
commit 5cd6c1236c
3 changed files with 18 additions and 1 deletions

View File

@ -26,6 +26,7 @@
- compute
- cinder
has_primary: true
require_online: true
limits:
min: 1
overrides:

View File

@ -346,6 +346,21 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, controls, compo
} else if (networkVerificationTask.match({status: 'running'})) {
return makeComponent(i18n(this.ns + 'verification_in_progress'));
}
},
// Offline nodes
function(cluster) {
var messages = [],
nodes = cluster.get('nodes');
cluster.get('release').get('role_models').each(function(role) {
if (role.get('require_online')) {
nodes.each(function(node) {
if (!node.get('online') && !node.get('pending_deletion') && node.hasRole(role.get('name'))) {
messages.push(i18n(this.ns + 'offline_nodes', {roleName: role.get('label')}));
}
}, this);
}
}, this);
return {blocker: messages};
}
],
validate: function(cluster) {

View File

@ -690,7 +690,8 @@
"get_more_info": "For more information please visit the",
"networks_link": "Networks tab",
"invalid_settings": "Environment settings are invalid.",
"settings_link": "Settings tab"
"settings_link": "Settings tab",
"offline_nodes": "All __roleName__ nodes must be online."
},
"show_node": {
"manufacturer_label": "Manufacturer",