From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci cluster/resource_form_handlers.js s ...
Date: 30 Jul 2007 02:24:16 -0000 [thread overview]
Message-ID: <20070730022416.650.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-07-30 02:24:16
Modified files:
luci/cluster : resource_form_handlers.js
luci/site/luci/Extensions: LuciClusterInfo.py RicciQueries.py
cluster_adapters.py
Log message:
Fixes from the RHEL5 branch
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/RicciQueries.py.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.263&r2=1.264
--- conga/luci/cluster/resource_form_handlers.js 2007/07/11 22:47:07 1.37
+++ conga/luci/cluster/resource_form_handlers.js 2007/07/30 02:24:15 1.38
@@ -523,8 +523,11 @@
if (!svc_name)
errors.push('No name was given for this service.');
- if (!form_xml)
- errors.push('No resource information was submitted.');
+ /*
+ ** allow creation of empty services.
+ ** if (!form_xml)
+ ** errors.push('No resource information was submitted.');
+ */
if (recovery && recovery != 'relocate' && recovery != 'restart' && recovery != 'disable') {
errors.push('You entered an invalid recovery option. Valid options are "relocate" "restart" and "disable"');
@@ -534,7 +537,12 @@
return (-1);
/* sort this out in the backend */
- master_form.form_xml.value = '<formlist>' + form_xml + '</formlist>';
+ if (form_xml) {
+ master_form.form_xml.value = '<formlist>' + form_xml + '</formlist>';
+ } else {
+ /* empty service */
+ master_form.form_xml.value = ' ';
+ }
master_form.svc_name.value = svc_name;
if (domain)
master_form.domain.value = domain;
--- conga/luci/site/luci/Extensions/LuciClusterInfo.py 2007/07/27 16:43:47 1.8
+++ conga/luci/site/luci/Extensions/LuciClusterInfo.py 2007/07/30 02:24:15 1.9
@@ -528,7 +528,9 @@
fdom_map['nodeslist'] = nodelist
svclist = list()
- for svc in model.getServices():
+ tmp = model.getServices()
+ tmp.extend(model.getVMs())
+ for svc in tmp:
svcname = svc.getName()
for sitem in slist:
if sitem['name'] == svcname:
@@ -537,7 +539,10 @@
svcmap = {}
svcmap['name'] = svcname
svcmap['status'] = sitem['running']
- svcmap['svcurl'] = '%s?pagetype=%s&clustername=%s&servicename=%s' % (baseurl, SERVICE, clustername, svcname)
+ if svc.getTagName() == 'vm':
+ svcmap['svcurl'] = '%s?pagetype=%s&clustername=%s&servicename=%s' % (baseurl, VM_CONFIG, clustername, svcname)
+ else:
+ svcmap['svcurl'] = '%s?pagetype=%s&clustername=%s&servicename=%s' % (baseurl, SERVICE, clustername, svcname)
svcmap['location'] = sitem['nodename']
svclist.append(svcmap)
fdom_map['svclist'] = svclist
--- conga/luci/site/luci/Extensions/RicciQueries.py 2007/07/27 16:43:47 1.5
+++ conga/luci/site/luci/Extensions/RicciQueries.py 2007/07/30 02:24:15 1.6
@@ -671,6 +671,8 @@
return resultlist
def getClusterConf(rc):
+ import xml.dom
+
if rc is None:
return None
@@ -712,7 +714,9 @@
var_nodes = ret.getElementsByTagName('var')
for i in var_nodes:
if i.getAttribute('name') == 'cluster.conf':
- return i.childNodes[0]
+ for j in i.childNodes:
+ if j.nodeType == xml.dom.Node.ELEMENT_NODE:
+ return j
if LUCI_DEBUG_MODE is True:
luci_log.debug_verbose('GCC2: no conf node found')
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2007/07/27 16:43:47 1.263
+++ conga/luci/site/luci/Extensions/cluster_adapters.py 2007/07/30 02:24:15 1.264
@@ -720,9 +720,10 @@
form_xml = fvar['form_xml']
if form_xml is None:
+ form_xml = ''
if LUCI_DEBUG_MODE is True:
luci_log.debug_verbose('vSA0: no form_xml')
- return (False, { 'errors': [ 'No resource data was supplied for this service' ]})
+
model = LuciExtractCluModel(self, request, clustername)
if model is None:
@@ -730,15 +731,17 @@
luci_log.debug_verbose('vSA1: no model')
return (False, { 'errors': [ 'Unable to retrieve the cluster configuration for %s. The configuration XML may contain errors' % clustername ]})
- try:
- doc = minidom.parseString(form_xml)
- forms = doc.getElementsByTagName('form')
- if len(forms) < 1:
- raise Exception, 'invalid XML'
- except Exception, e:
- if LUCI_DEBUG_MODE is True:
- luci_log.debug_verbose('vSA1: error: %r %s' % (e, str(e)))
- return (False, { 'errors': [ 'The resource data submitted for this service is not properly formed' ]})
+ forms = []
+ if form_xml.strip():
+ try:
+ doc = minidom.parseString(form_xml)
+ forms = doc.getElementsByTagName('form')
+ if len(forms) < 1:
+ raise Exception, 'invalid XML'
+ except Exception, e:
+ if LUCI_DEBUG_MODE is True:
+ luci_log.debug_verbose('vSA1: error: %r %s: %r' % (e, str(e), form_xml))
+ return (False, { 'errors': [ 'The resource data submitted for this service is not properly formed' ]})
form_hash = {}
form_hash['toplevel'] = { 'form': None, 'kids': [] }
next reply other threads:[~2007-07-30 2:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-30 2:24 rmccabe [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-07-27 19:11 [Cluster-devel] conga/luci cluster/resource_form_handlers.js s rmccabe
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=20070730022416.650.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.