* [Cluster-devel] conga/luci cluster/resource_form_handlers.js h ...
@ 2006-09-25 17:36 rmccabe
0 siblings, 0 replies; 3+ messages in thread
From: rmccabe @ 2006-09-25 17:36 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-09-25 17:36:02
Modified files:
luci/cluster : resource_form_handlers.js
luci/homebase : luci_homebase.css
luci/site/luci/Extensions: cluster_adapters.py
Log message:
style and javascript tweaks
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.67&r2=1.68
--- conga/luci/cluster/resource_form_handlers.js 2006/09/23 04:04:08 1.12
+++ conga/luci/cluster/resource_form_handlers.js 2006/09/25 17:36:02 1.13
@@ -215,8 +215,6 @@
if (!f[i].global || !f[i].global.value)
continue;
replace[f[i].parentNode.id] = f[i].parentNode;
- if (f[i].parentNode.parentNode)
- f[i].parentNode.parentNode.removeChild(f[i].parentNode);
}
var sopt = document.getElementById('gres_chooser');
@@ -225,6 +223,8 @@
sopt = sopt.options;
for (var i = 0 ; i < sopt.length ; i++) {
if (replace[sopt[i].value]) {
+ if (replace[sopt[i].value].parentNode)
+ replace[sopt[i].value].parentNode.parentNode.removeChild(replace[sopt[i].value].parentNode);
globalres.appendChild(replace[sopt[i].value]);
sopt[i].className = null;
}
@@ -335,6 +335,10 @@
continue;
} else if (!form[i].uuid || !form[i].uuid.value)
continue;
+
+ var err = validate_form(form[i]);
+ if (err)
+ errors.concat(err);
var temp = form[i].innerHTML.match(/<input [^>]+>/ig).toString().replace(/>(,|$)/g, '/>');
if (!temp)
continue;
@@ -342,6 +346,9 @@
form[i].parent_uuid.value + '">' + temp + '</form>';
}
+ if (error_dialog(errors))
+ return (-1);
+
if (!master_form || !form_xml)
return (-1);
--- conga/luci/homebase/luci_homebase.css 2006/09/23 04:04:08 1.23
+++ conga/luci/homebase/luci_homebase.css 2006/09/25 17:36:02 1.24
@@ -1,11 +1,11 @@
input[type=text], input[type=password] {
padding: .2em ! important;
font-family: "Bitstream Vera Sans Mono", "DejaVu Sans Mono", monospace;
- font-size: 11px;
+ font-size: 12px;
}
input[type=button] {
- font-size: 11px;
+ font-size: 12px;
}
input[type=checkbox], input[type=radio] {
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/09/23 04:04:08 1.67
+++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/09/25 17:36:02 1.68
@@ -386,7 +386,7 @@
ndadd = {}
- ndadd['Title'] = "Add A Node"
+ ndadd['Title'] = "Add a Node"
ndadd['cfg_type'] = "nodeadd"
ndadd['absolute_url'] = url + "?pagetype=" + NODE_ADD + "&clustername=" + cluname
ndadd['Description'] = "Add a node to this cluster"
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] conga/luci cluster/resource_form_handlers.js h ...
@ 2006-09-29 21:41 rmccabe
0 siblings, 0 replies; 3+ messages in thread
From: rmccabe @ 2006-09-29 21:41 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-09-29 21:41:43
Modified files:
luci/cluster : resource_form_handlers.js
luci/homebase : index_html
luci/site/luci/Extensions: ricci_bridge.py ricci_communicator.py
Log message:
improve the robustness of the ssl socket code
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/index_html.diff?cvsroot=cluster&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&r1=1.5&r2=1.6
--- conga/luci/cluster/resource_form_handlers.js 2006/09/27 22:24:11 1.15
+++ conga/luci/cluster/resource_form_handlers.js 2006/09/29 21:41:43 1.16
@@ -106,7 +106,7 @@
} else
clr_form_error(form.mountpoint);
- if (!form.host || str_is_blank(form.host.value))
+ if (!form.host || str_is_blank(form.host.value)) {
errors.push('No NFS server host was given.');
set_form_error(form.host);
} else
--- conga/luci/homebase/index_html 2006/09/27 22:49:09 1.16
+++ conga/luci/homebase/index_html 2006/09/29 21:41:43 1.17
@@ -15,7 +15,7 @@
xml:lang language">
<tal:comment replace="nothing">
- $Id: index_html,v 1.16 2006/09/27 22:49:09 rmccabe Exp $
+ $Id: index_html,v 1.17 2006/09/29 21:41:43 rmccabe Exp $
</tal:comment>
<head metal:use-macro="here/header/macros/html_header">
@@ -66,6 +66,7 @@
<body tal:attributes="class here/getSectionFromURL;
dir python:test(isRTL, 'rtl', 'ltr')">
+
<div id="visual-portal-wrapper">
<div id="portal-top" i18n:domain="plone">
--- conga/luci/site/luci/Extensions/ricci_bridge.py 2006/09/25 22:59:15 1.19
+++ conga/luci/site/luci/Extensions/ricci_bridge.py 2006/09/29 21:41:43 1.20
@@ -19,10 +19,14 @@
def process(self, xml_out):
CLUSTER_STR='<?xml version="1.0" ?><ricci async="false" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="get_cluster.conf"/></request></module></batch></ricci>'
- doc = self.makeConnection(CLUSTER_STR)
-
- if doc == None:
- print "Sorry, doc is None"
+ docc = None
+ try:
+ doc = self.makeConnection(CLUSTER_STR)
+ except RicciReceiveError, r:
+ return None
+
+ #if doc == None:
+ # print "Sorry, doc is None"
if doc != None:
bt_node = None
for node in doc.firstChild.childNodes:
@@ -30,7 +34,7 @@
if node.nodeName == 'batch':
bt_node = node
if bt_node == None:
- print "bt_node == None"
+ #print "bt_node == None"
doc = None
else:
#print doc.toxml()
@@ -40,7 +44,7 @@
if node.nodeName == 'module':
mod_node = node
if mod_node == None:
- print "mod_node == None"
+ #print "mod_node == None"
doc = None
else:
resp_node = None
@@ -48,7 +52,7 @@
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
resp_node = node
if resp_node == None:
- print "resp_node == None"
+ #print "resp_node == None"
doc = None
else:
fr_node = None
@@ -56,7 +60,7 @@
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
fr_node = node
if fr_node == None:
- print "fr_node == None"
+ #print "fr_node == None"
doc = None
else:
varnode = None
@@ -65,7 +69,7 @@
varnode = node
break
if varnode == None:
- print "varnode == None"
+ #print "varnode == None"
doc = None
else:
cl_node = None
@@ -74,7 +78,7 @@
cl_node = node
break
if cl_node == None:
- print "cl_node == None"
+ #print "cl_node == None"
doc = None
else:
docc = minidom.Document()
@@ -83,7 +87,7 @@
return docc
def __sendall(self, str, ssl_sock):
- print str
+ #print str
s = str
while len(s) != 0:
pos = ssl_sock.write(s)
@@ -119,29 +123,41 @@
CLUSTER_STR='<?xml version="1.0" ?><ricci async="false" function="process_batch" version="1.0"><batch><module name="cluster"><request API_version="1.0"><function_call name="status"/></request></module></batch></ricci>'
# socket
sock = socket(AF_INET, SOCK_STREAM)
- sock.connect((self.__hostname, self.__port))
- ss = ssl(sock, PATH_TO_PRIVKEY, PATH_TO_CACERT)
+ try:
+ sock.connect((self.__hostname, self.__port))
+ except:
+ sock.close()
+ return ''
+
+ ss = 0
+ try:
+ ss = ssl(sock, PATH_TO_PRIVKEY, PATH_TO_CACERT)
+ except sslerror, e:
+ if ss:
+ del ss
+ sock.close()
+ return ''
# receive ricci header
hello = self.__receive(ss)
if hello != None:
pass
#print hello.toxml()
+
try:
self.__sendall(CLUSTER_STR, ss)
+ doc = self.__receive(ss)
except sslerror, e:
- sock.close()
- return ''
+ doc = None
- # receive response
- doc = self.__receive(ss)
- if doc == None:
- print "Sorry, doc is None"
- else:
- payload = self.extractPayload(doc)
- sock.shutdown(2)
+ del ss
sock.close()
+ if doc == None:
+ return ''
+ #print "Sorry, doc is None"
+
+ payload = self.extractPayload(doc)
return payload
def startService(self,servicename, preferrednode = None):
@@ -204,25 +220,29 @@
def makeConnection(self,query_str):
# socket
sock = socket(AF_INET, SOCK_STREAM)
- sock.connect((self.__hostname, self.__port))
- ss = ssl(sock, PATH_TO_PRIVKEY, PATH_TO_CACERT)
+ try:
+ sock.connect((self.__hostname, self.__port))
+ except:
+ sock.close()
+ return None
- # receive ricci header
- hello = self.__receive(ss)
- print >> sys.stderr, hello.toxml()
- if hello != None:
- pass
- #print hello.toxml()
- self.__sendall(query_str, ss)
-
-
- # receive response
- payload = self.__receive(ss)
- if payload == None:
- raise RicciReceiveError('FATAL',"Unable to receive ricci data for %s" % self.__hostname)
- sock.shutdown(2)
+ ss = 0
+ try:
+ ss = ssl(sock, PATH_TO_PRIVKEY, PATH_TO_CACERT)
+ hello = self.__receive(ss)
+ #print >> sys.stderr, hello.toxml()
+ self.__sendall(query_str, ss)
+ # receive response
+ payload = self.__receive(ss)
+ except sslerror, e:
+ payload = None
+
+ if ss:
+ del ss
sock.close()
+ if payload == None:
+ raise RicciReceiveError('FATAL',"Unable to receive ricci data for %s" % self.__hostname)
return payload
@@ -341,7 +361,7 @@
if node.nodeName == 'batch':
bt_node = node
if bt_node == None:
- print "bt_node == None"
+ #print "bt_node == None"
doc = None
else:
#print doc.toxml()
@@ -351,7 +371,7 @@
if node.nodeName == 'module':
mod_node = node
if mod_node == None:
- print "mod_node == None"
+ #print "mod_node == None"
doc = None
else:
resp_node = None
@@ -359,7 +379,7 @@
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
resp_node = node
if resp_node == None:
- print "resp_node == None"
+ #print "resp_node == None"
doc = None
else:
fr_node = None
@@ -367,7 +387,7 @@
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
fr_node = node
if fr_node == None:
- print "fr_node == None"
+ #print "fr_node == None"
doc = None
else:
varnode = None
@@ -376,7 +396,7 @@
varnode = node
break
if varnode == None:
- print "varnode == None"
+ #print "varnode == None"
doc = None
else:
cl_node = None
@@ -385,7 +405,7 @@
cl_node = node
break
if cl_node == None:
- print "cl_node == None"
+ #print "cl_node == None"
doc = None
else:
docc = minidom.Document()
@@ -402,7 +422,7 @@
if node.nodeName == 'batch':
bt_node = node
if bt_node == None:
- print "bt_node == None"
+ #print "bt_node == None"
doc = None
else:
#print doc.toxml()
@@ -412,7 +432,7 @@
if node.nodeName == 'module':
mod_node = node
if mod_node == None:
- print "mod_node == None"
+ #print "mod_node == None"
doc = None
else:
resp_node = None
@@ -420,7 +440,7 @@
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
resp_node = node
if resp_node == None:
- print "resp_node == None"
+ #print "resp_node == None"
doc = None
else:
fr_node = None
@@ -428,7 +448,7 @@
if node.nodeType == xml.dom.Node.ELEMENT_NODE:
fr_node = node
if fr_node == None:
- print "fr_node == None"
+ #print "fr_node == None"
doc = None
else:
varnode = None
@@ -437,7 +457,7 @@
varnode = node
break
if varnode == None:
- print "varnode == None"
+ #print "varnode == None"
doc = None
else:
svc_node = None
@@ -462,20 +482,41 @@
result = node.getAttribute('status')
return (batch_number, result)
else:
- print "RETURNING NONE!!!"
+ #print "RETURNING NONE!!!"
return (None, None )
def getRicciResponse(self):
sock = socket(AF_INET, SOCK_STREAM)
+ sock.settimeout(2.0)
try:
sock.connect((self.__hostname, self.__port))
except:
+ sock.close()
return False
- ss = ssl(sock, PATH_TO_PRIVKEY, PATH_TO_CACERT)
+
+ ss = 0
+ try:
+ ss = ssl(sock, PATH_TO_PRIVKEY, PATH_TO_CACERT)
+ except sslerror, e:
+ if ss:
+ del ss
+ sock.close()
+ return False
+ sock.settimeout(600.0) # 10 minutes
+ # TODO: data transfer timeout should be much less,
+ # leave until all calls are async ricci calls
+
# receive ricci header
- hello = self.__receive(ss)
+ try:
+ hello = self.__receive(ss)
+ except sslerror, e:
+ hello = None
+
+ del ss
+ sock.close()
+
if hello != None:
return True
else:
--- conga/luci/site/luci/Extensions/ricci_communicator.py 2006/09/26 21:04:47 1.5
+++ conga/luci/site/luci/Extensions/ricci_communicator.py 2006/09/29 21:41:43 1.6
@@ -164,7 +164,7 @@
def __send(self, xml_doc):
buff = xml_doc.toxml() + '\n'
- print buff
+ #print buff
while len(buff) != 0:
pos = self.ss.write(buff)
buff = buff[pos:]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] conga/luci cluster/resource_form_handlers.js h ...
@ 2006-10-30 21:21 rmccabe
0 siblings, 0 replies; 3+ messages in thread
From: rmccabe @ 2006-10-30 21:21 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-10-30 21:21:17
Modified files:
luci/cluster : resource_form_handlers.js
luci/homebase : form-macros
luci/site/luci/Extensions: ricci_bridge.py
Log message:
- fix for javascript FS resource validation (would always say you had not selected a FS type)
- fix for batchAttemptResult function decl: callers expect to pass only one argument
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&r1=1.36&r2=1.37
--- conga/luci/cluster/resource_form_handlers.js 2006/10/07 20:12:47 1.20
+++ conga/luci/cluster/resource_form_handlers.js 2006/10/30 21:21:16 1.21
@@ -140,7 +140,7 @@
function validate_filesystem(form) {
var errors = new Array();
- if (!form.fsTypeSelect || str_is_blank(form.fsTypeSelect.value)) {
+ if (!form.fstype || str_is_blank(form.fstype.value)) {
errors.push('No file system type was given.');
set_form_err(form.fsTypeSelect);
} else
--- conga/luci/homebase/form-macros 2006/10/30 20:42:03 1.45
+++ conga/luci/homebase/form-macros 2006/10/30 21:21:16 1.46
@@ -1,7 +1,7 @@
<html>
<tal:comment tal:replace="nothing">
- $Id: form-macros,v 1.45 2006/10/30 20:42:03 rmccabe Exp $
+ $Id: form-macros,v 1.46 2006/10/30 21:21:16 rmccabe Exp $
</tal:comment>
<head>
@@ -560,8 +560,6 @@
<tal:block tal:condition="python: not request.SESSION.has_key('checkRet')"
tal:define="global sessionObj python:{}" />
- <tal:block tal:define="
-
<h2 class="homebase">Add Cluster</h2>
<form name="adminform" action="" method="post"
--- conga/luci/site/luci/Extensions/ricci_bridge.py 2006/10/26 22:59:13 1.36
+++ conga/luci/site/luci/Extensions/ricci_bridge.py 2006/10/30 21:21:17 1.37
@@ -206,7 +206,7 @@
return minidom.parseString(batch).firstChild
-def batchAttemptResult(self, doc):
+def batchAttemptResult(doc):
try:
batch = doc.getElementsByTagName('batch')
if not batch or len(batch) < 1:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-30 21:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-29 21:41 [Cluster-devel] conga/luci cluster/resource_form_handlers.js h rmccabe
-- strict thread matches above, loose matches on Subject: below --
2006-10-30 21:21 rmccabe
2006-09-25 17:36 rmccabe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).