From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga luci/site/luci/Extensions/LuciClusterAct ...
Date: 20 Aug 2007 16:27:23 -0000 [thread overview]
Message-ID: <20070820162723.13977.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2007-08-20 16:27:22
Modified files:
luci/site/luci/Extensions: LuciClusterActions.py LuciDB.py
LuciZope.py
luci/storage : form-macros
ricci/modules/cluster: Clusvcadm.cpp
Log message:
Fixes from the -RHEL5 branch
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterActions.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.4.2.1&r2=1.4.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciDB.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.6.2.1&r2=1.6.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZope.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.4.2.1&r2=1.4.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.20.2.1&r2=1.20.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Clusvcadm.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.8.2.4&r2=1.8.2.5
--- conga/luci/site/luci/Extensions/LuciClusterActions.py 2007/08/09 21:35:19 1.4.2.1
+++ conga/luci/site/luci/Extensions/LuciClusterActions.py 2007/08/20 16:27:21 1.4.2.2
@@ -364,6 +364,10 @@
exclude_names=[ nodename_resolved ], exclude_busy=True)
if rc2 is None:
+ rc2 = getRicciAgent(self, clustername,
+ exclude_names=[ nodename_resolved ])
+
+ if rc2 is None:
if LUCI_DEBUG_MODE is True:
luci_log.debug_verbose('ND0: unable to find ricci agent to delete %s from %s' % (nodename_resolved, clustername))
return None
@@ -589,9 +593,11 @@
def NodeFence(self, clustername, nodename, nodename_resolved):
rc = getRicciAgent(self, clustername,
exclude_names=[ nodename_resolved, nodename ], exclude_busy=True)
+
if rc is None:
rc = getRicciAgent(self, clustername,
exclude_names=[ nodename_resolved, nodename ])
+
if rc is None:
if LUCI_DEBUG_MODE is True:
luci_log.debug_verbose('FNF0: no ricci to fence %s for cluster %s' \
@@ -636,6 +642,7 @@
if rc is None:
rc = getRicciAgent(self, clustername, exclude_busy=True)
+
if rc is None:
rc = getRicciAgent(self, clustername)
--- conga/luci/site/luci/Extensions/LuciDB.py 2007/08/09 21:35:20 1.6.2.1
+++ conga/luci/site/luci/Extensions/LuciDB.py 2007/08/20 16:27:21 1.6.2.2
@@ -852,7 +852,7 @@
continue
if exclude_busy is True:
- if NodeBusy(self, cluname, ricci_hostname, rc) is not False:
+ if NodeBusy(self, clustername, ricci_hostname, rc) is not False:
if LUCI_DEBUG_MODE is True:
luci_log.debug_verbose('GRA13: %s is busy, excluding' \
% ricci_hostname)
@@ -861,7 +861,7 @@
if LUCI_DEBUG_MODE is True:
luci_log.debug('GRA14: no ricci agent could be found for cluster %s' \
- % cluname)
+ % clustername)
return None
def getClusterDBObj(self, clustername):
--- conga/luci/site/luci/Extensions/LuciZope.py 2007/08/09 21:35:20 1.4.2.1
+++ conga/luci/site/luci/Extensions/LuciZope.py 2007/08/20 16:27:21 1.4.2.2
@@ -126,7 +126,7 @@
def GetReqVars(req, varlist):
ret = {}
- from types import ListType;
+ from types import ListType
for i in varlist:
pval = None
--- conga/luci/storage/form-macros 2007/08/09 21:28:53 1.20.2.1
+++ conga/luci/storage/form-macros 2007/08/20 16:27:22 1.20.2.2
@@ -615,7 +615,7 @@
id="graphics_checkbox_id"
tal:attributes="checked mapper/graphical_view"
onchange="var s = (this.checked)?'graphical_view':'textual_view'; singleVisibleSpan('mappings_view', s);"/>
- Graphical View
+ Graphical View <small>(Uncheck if volumes are too small to select)</small>
<span id="mappings_view"
tal:define="mappings_view_classnames mapper/mappings-view_css_classnames">
@@ -1068,7 +1068,7 @@
type string:text;
value prop/value;
onkeypress python:'return validate_text_keypress(this, event, 2, \'' + prop['validation']['illegal_chars'] + '\', ' + str(prop['validation']['max_length']) + ')';
- onblur python:'validate_text(this, 2, \'' + prop['validation']['illegal_chars'] + '\', \'' + prop['validation']['reserved_words'] + '\', ' + str(prop['validation']['min_length']) + ', ' + str(prop['validation']['max_length']) + ', \'' + form_submit_button_id + '\')'"/>
+ onchange python:'validate_text(this, 2, \'' + prop['validation']['illegal_chars'] + '\', \'' + prop['validation']['reserved_words'] + '\', ' + str(prop['validation']['min_length']) + ', ' + str(prop['validation']['max_length']) + ', \'' + form_submit_button_id + '\')'"/>
@@ -1078,7 +1078,7 @@
type string:text;
size string:15;
value prop/value;
- onblur python:'validate_int(this, 2, ' + str(prop['validation']['min']) + ', ' + str(prop['validation']['max']) + ', ' + str(prop['validation']['step']) + ', \'' + prop_units + '\', \'' + form_submit_button_id + '\')'"
+ onchange python:'validate_int(this, 2, ' + str(prop['validation']['min']) + ', ' + str(prop['validation']['max']) + ', ' + str(prop['validation']['step']) + ', \'' + prop_units + '\', \'' + form_submit_button_id + '\')'"
onkeypress="return validate_int_keypress(this, event, 2)"/>
(<span tal:replace="prop/validation/min"/> - <span tal:replace="prop/validation/max"/>)
<span tal:replace="prop_units"/>
@@ -1096,7 +1096,7 @@
type string:text;
size string:15;
value value;
- onblur python:'validate_float(this, 2, ' + str(minim) + ', ' + str(maxim) + ', ' + str(step) + ', \'' + units + '\', \'' + form_submit_button_id + '\')'"
+ onchange python:'validate_float(this, 2, ' + str(minim) + ', ' + str(maxim) + ', ' + str(step) + ', \'' + units + '\', \'' + form_submit_button_id + '\')'"
onkeypress="return validate_float_keypress(this, event, 2)"/>
(<span tal:replace="minim"/> - <span tal:replace="maxim"/>)
<span tal:replace="units"/>
@@ -1422,9 +1422,15 @@
return ev.which;
}
+var pending_warning = false;
+
function display_warning(el, timeout, text)
{
- alert(text);
+ if (!pending_warning) {
+ pending_warning = true;
+ alert(text);
+ pending_warning = false;
+ }
return;
var geom_obj = getGeom(el);
--- conga/ricci/modules/cluster/Clusvcadm.cpp 2007/03/12 03:46:20 1.8.2.4
+++ conga/ricci/modules/cluster/Clusvcadm.cpp 2007/08/20 16:27:22 1.8.2.5
@@ -1,5 +1,5 @@
/*
- Copyright Red Hat, Inc. 2005
+ Copyright Red Hat, Inc. 2005-2007
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -89,7 +89,7 @@
if (*iter == nodename)
node_found = true;
if (!node_found && nodename.size())
- throw String("node unable to run services");
+ throw String("Node " + nodename + " is unable to run cluster services. Check whether the rgmanager service is running");
// start
for (list<ServiceStatus>::const_iterator iter = services.begin();
@@ -100,10 +100,20 @@
if (iter->status == ServiceStatus::RG_STATE_MIGRATE)
throw String(servicename + " is in the process of being migrated");
-
- if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
+
+ /*
+ ** Failed services must be disabled before they can be
+ ** started again.
+ */
+ if (iter->status == ServiceStatus::RG_STATE_FAILED) {
+ try {
+ Clusvcadm::stop(servicename);
+ } catch ( ... ) {
+ throw String("Unable to disable failed service " + servicename + " before starting it");
+ }
+ flag = "-e";
+ } else if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
iter->status == ServiceStatus::RG_STATE_STOPPING ||
- iter->status == ServiceStatus::RG_STATE_FAILED ||
iter->status == ServiceStatus::RG_STATE_ERROR ||
iter->status == ServiceStatus::RG_STATE_DISABLED)
flag = "-e";
@@ -127,12 +137,12 @@
if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false))
throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH);
if (status != 0)
- throw String("clusvcadm failed");
+ throw String("clusvcadm failed to start " + servicename);
}
return;
}
- throw String("no such service");
+ throw String(servicename + ": no such cluster service");
}
void
@@ -150,7 +160,7 @@
if (*iter == nodename)
node_found = true;
if (!node_found && nodename.size())
- throw String("node unable to run services");
+ throw String("Node " + nodename + " is unable to run cluster services. Check whether the rgmanager service is running");
// start
for (list<ServiceStatus>::const_iterator iter = services.begin();
@@ -162,9 +172,16 @@
String flag;
if (iter->status == ServiceStatus::RG_STATE_MIGRATE)
throw String(servicename + " is already in the process of being migrated");
- if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
+
+ if (iter->status == ServiceStatus::RG_STATE_FAILED) {
+ try {
+ Clusvcadm::stop(servicename);
+ } catch ( ... ) {
+ throw String("Unable to disable failed service " + servicename + " before starting it");
+ }
+ flag = "-e";
+ } else if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
iter->status == ServiceStatus::RG_STATE_STOPPING ||
- iter->status == ServiceStatus::RG_STATE_FAILED ||
iter->status == ServiceStatus::RG_STATE_ERROR ||
iter->status == ServiceStatus::RG_STATE_DISABLED)
flag = "-e";
@@ -185,13 +202,13 @@
if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false))
throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH);
if (status != 0)
- throw String("clusvcadm failed");
+ throw String("clusvcadm failed to migrate " + servicename);
}
return;
}
}
- throw String("no such virtual service");
+ throw String(servicename + ": no such virtual machine service");
}
void
@@ -206,6 +223,7 @@
iter++)
if (iter->name == servicename) {
if (iter->status == ServiceStatus::RG_STATE_STARTING ||
+ iter->status == ServiceStatus::RG_STATE_FAILED ||
iter->status == ServiceStatus::RG_STATE_STARTED) {
String out, err;
int status;
@@ -218,12 +236,12 @@
if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false))
throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH);
if (status != 0)
- throw String("clusvcadm failed");
+ throw String("clusvcadm failed to stop " + servicename);
}
return;
}
- throw String("no such service");
+ throw String(servicename + ": no such cluster service");
}
void
@@ -243,9 +261,15 @@
if (iter->status == ServiceStatus::RG_STATE_STARTING)
throw String(servicename + " is in the process of being started");
- if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
+ if (iter->status == ServiceStatus::RG_STATE_FAILED) {
+ try {
+ Clusvcadm::stop(servicename);
+ } catch ( ... ) {
+ throw String("Unable to disable failed service " + servicename + " before starting it");
+ }
+ flag = "-e";
+ } else if (iter->status == ServiceStatus::RG_STATE_STOPPED ||
iter->status == ServiceStatus::RG_STATE_STOPPING ||
- iter->status == ServiceStatus::RG_STATE_FAILED ||
iter->status == ServiceStatus::RG_STATE_ERROR ||
iter->status == ServiceStatus::RG_STATE_DISABLED)
flag = "-e";
@@ -264,12 +288,12 @@
if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false))
throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH);
if (status != 0)
- throw String("clusvcadm failed");
+ throw String("clusvcadm failed to restart cluster service " + servicename);
}
return;
}
- throw String("no such service");
+ throw String(servicename + ": no such cluster service");
}
reply other threads:[~2007-08-20 16:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070820162723.13977.qmail@sourceware.org \
--to=rmccabe@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.