* [Cluster-devel] conga/luci homebase/form-macros site/luci/Exte ...
@ 2006-06-30 21:39 rmccabe
0 siblings, 0 replies; 4+ messages in thread
From: rmccabe @ 2006-06-30 21:39 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-06-30 21:39:51
Modified files:
luci/homebase : form-macros
luci/site/luci/Extensions: homebase_adapters.py
Log message:
fix blank page homebase bug
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.9&r2=1.10
--- conga/luci/homebase/form-macros 2006/06/30 18:06:10 1.25
+++ conga/luci/homebase/form-macros 2006/06/30 21:39:51 1.26
@@ -1,7 +1,7 @@
<html>
<tal:comment replace="nothing">
- $Id: form-macros,v 1.25 2006/06/30 18:06:10 rmccabe Exp $
+ $Id: form-macros,v 1.26 2006/06/30 21:39:51 rmccabe Exp $
</tal:comment>
<head>
@@ -67,10 +67,12 @@
</select>
<input name="pagetype" type="hidden"
- tal:attributes="value request/pagetype | request/form/pagetype | nothing" />
+ tal:attributes="value request/form/pagetype | request/pagetype | nothing" />
<input name="absoluteURL" type="hidden"
tal:attributes="value python:data['children'][data['curIndex']]['absolute_url']" />
+ <input name="baseURL" type="hidden"
+ tal:attributes="value python:data['children'][data['curIndex']]['base_url']" />
<div class="hbSubmit" tal:condition="python:userList" id="hbSubmit">
<input class="hbSubmit" name="Submit" type="button" value="Submit" onClick="validateForm(document.adminform);" />
@@ -129,10 +131,12 @@
</table>
<input name="pagetype" type="hidden"
- tal:attributes="value request/pagetype | request/form/pagetype | nothing" />
+ tal:attributes="value request/form/pagetype | request/pagetype | nothing" />
<input name="absoluteURL" type="hidden"
tal:attributes="value python:data['children'][data['curIndex']]['absolute_url']" />
+ <input name="baseURL" type="hidden"
+ tal:attributes="value python:data['children'][data['curIndex']]['base_url']" />
<div class="hbSubmit" id="hbSubmit">
<input class="hbSubmit" name="Submit" type="button" value="Submit" onClick="validateForm(document.adminform);" />
@@ -180,13 +184,15 @@
<input name="absoluteURL" type="hidden"
tal:attributes="value python:data['children'][data['curIndex']]['absolute_url']" />
+ <input name="baseURL" type="hidden"
+ tal:attributes="value python:data['children'][data['curIndex']]['base_url']" />
<input name="pagetype" type="hidden"
- tal:attributes="value request/pagetype | request/form/pagetype | nothing" />
+ tal:attributes="value request/form/pagetype | request/pagetype | nothing" />
<span tal:condition="python:perms" tal:content="string:Select a User" /><br/>
- <select tal:omit-tag="python: not perms" class="homebase" name="userList" onChange="document.location = adminform.absoluteURL.value + '&user=' + adminform.userList.options[adminform.userList.selectedIndex].text">
+ <select tal:omit-tag="python: not perms" class="homebase" name="userList" onChange="document.location = adminform.baseURL.value + '&user=' + adminform.userList.options[adminform.userList.selectedIndex].text">
<tal:block tal:repeat="user python:perms">
<option class="homebase"
tal:content="python:user"
@@ -307,7 +313,7 @@
</h2>
<input type="hidden" name="pagetype"
- tal:attributes="value request/pagetype | request/form/pagetype | nothing" />
+ tal:attributes="value request/form/pagetype | request/pagetype | nothing" />
<h3 class="homebase" tal:condition="python: systems[0] and len(systems[0]) > 0">
Clusters
@@ -419,12 +425,14 @@
<h2 class="homebase">Add a Storage System</h2>
<input name="pagetype" type="hidden"
- tal:attributes="value request/pagetype | request/form/pagetype | nothing" />
+ tal:attributes="value request/form/pagetype | request/pagetype | nothing" />
<input name="numStorage" id="numStorage" type="hidden" value="1" />
<input name="absoluteURL" type="hidden"
tal:attributes="value python:data['children'][data['curIndex']]['absolute_url']" />
+ <input name="baseURL" type="hidden"
+ tal:attributes="value python:data['children'][data['curIndex']]['base_url']" />
<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
@@ -493,12 +501,14 @@
tal:define="global clusters python:here.getClusters()" />
<input name="pagetype" type="hidden"
- tal:attributes="value request/pagetype | request/form/pagetype | nothing" />
+ tal:attributes="value request/form/pagetype | request/pagetype | nothing" />
<input name="numStorage" id="numStorage" type="hidden" value="3" />
<input name="absoluteURL" type="hidden"
tal:attributes="value python:data['children'][data['curIndex']]['absolute_url']" />
+ <input name="baseURL" type="hidden"
+ tal:attributes="value python:data['children'][data['curIndex']]['base_url']" />
<h2 class="homebase">Add Cluster</h2>
@@ -566,6 +576,5 @@
</form>
</div>
-
</body>
</html>
--- conga/luci/site/luci/Extensions/homebase_adapters.py 2006/06/27 20:53:12 1.9
+++ conga/luci/site/luci/Extensions/homebase_adapters.py 2006/06/30 21:39:51 1.10
@@ -5,6 +5,7 @@
from AccessControl import getSecurityManager
from ZPublisher import HTTPRequest
import xml.dom
+import cgi
from ricci_defines import *
from ricci_communicator import RicciCommunicator
@@ -133,7 +134,7 @@
return (False, {'errors': [ 'Unable to add new user \"' + user + '\"'] })
messages.append('Added new user \"' + user + '\" successfully')
- return (True, {'messages': messages, 'user': user, 'dest': HOMEBASE_PERMS })
+ return (True, {'messages': messages, 'params': { 'user': user }})
def validateAddCluster(self, request):
errors = list()
@@ -237,11 +238,11 @@
try:
userId = request.form['userList']
except:
- return (False, {'errors': [ 'No user specified' ], 'user': userId })
+ return (False, {'errors': [ 'No user specified' ], 'params': { 'user': userId }})
user = self.portal_membership.getMemberById(userId)
if not user:
- return (False, {'errors': [ 'Invalid user specified' ], 'user': userId })
+ return (False, {'errors': [ 'Invalid user specified' ], 'params': { 'user': userId }})
userId = user.getUserId()
@@ -332,7 +333,7 @@
else:
returnCode = True
- return (returnCode, {'errors': errors, 'messages': messages, 'user': userId })
+ return (returnCode, {'errors': errors, 'messages': messages, 'params': {'user': userId }})
formValidators = [
validateAddUser,
@@ -364,12 +365,8 @@
return False
def homebaseControlPost(self, request):
- if 'absoluteURL' in request.form:
- url = request.form['absoluteURL']
- elif 'ACTUAL_URL' in request:
+ if 'ACTUAL_URL' in request:
url = request['ACTUAL_URL']
- elif 'URL' in request:
- url = request['URL']
else:
url = '.'
@@ -385,7 +382,10 @@
ret = validatorFn(self, request)
request.SESSION.set('checkRet', ret[1])
- return homebasePortal(self, request, url, pagetype, ret[1])
+ params = None
+ if 'params' in ret[1]:
+ params = ret[1]['params']
+ return homebasePortal(self, request, url, pagetype, params)
def homebaseControl(self, request):
try:
@@ -396,17 +396,14 @@
if request.REQUEST_METHOD == 'POST':
return homebaseControlPost(self, request)
- try:
- url = request.form['absoluteURL']
- except:
- try:
- url = request['URL']
- except:
- url = '.'
+ if 'ACTUAL_URL' in request:
+ url = request['ACTUAL_URL']
+ else:
+ url = '.'
- try:
- pagetype = request.form['pagetype']
- except:
+ if 'pagetype' in request:
+ pagetype = request['pagetype']
+ else:
pagetype = '0'
return homebasePortal(self, request, url, pagetype)
@@ -415,6 +412,7 @@
ret = {}
temp = list()
index = 0
+ cur = None
try:
if havePermAddUser(self):
@@ -425,6 +423,7 @@
if pagetype == HOMEBASE_ADD_USER:
addUser['currentItem'] = True
ret['curIndex'] = index
+ cur = addUser
else:
addUser['currentItem'] = False
index += 1
@@ -440,6 +439,7 @@
if pagetype == HOMEBASE_DEL_USER:
delUser['currentItem'] = True
ret['curIndex'] = index
+ cur = delUser
else:
delUser['currentItem'] = False
index += 1
@@ -457,6 +457,7 @@
addSystem['absolute_url'] = url + '?pagetype=' + HOMEBASE_ADD_SYSTEM
addSystem['Description'] = 'Add a System'
if pagetype == HOMEBASE_ADD_SYSTEM:
+ cur = addSystem
addSystem['currentItem'] = True
ret['curIndex'] = index
else:
@@ -474,6 +475,7 @@
if pagetype == HOMEBASE_ADD_CLUSTER:
addCluster['currentItem'] = True
ret['curIndex'] = index
+ cur = addCluster
else:
addCluster['currentItem'] = False
index += 1
@@ -493,6 +495,7 @@
if pagetype == HOMEBASE_DEL_SYSTEM:
remSystem['currentItem'] = True
ret['curIndex'] = index
+ cur = remSystem
else:
remSystem['currentItem'] = False
index += 1
@@ -509,10 +512,9 @@
userPerm['absolute_url'] = url + '?pagetype=' + HOMEBASE_PERMS
userPerm['Description'] = 'Set permissions for users'
if pagetype == HOMEBASE_PERMS:
- if params and 'user' in params:
- userPerm['curUser'] += params['user']
userPerm['currentItem'] = True
ret['curIndex'] = index
+ cur = userPerm
else:
userPerm['currentItem'] = False
index += 1
@@ -522,6 +524,11 @@
if not 'curIndex' in ret:
ret['curIndex'] = 0
+ if cur and 'absolute_url' in cur and params:
+ cur['baseurl'] = cur['absolute_url']
+ for i in params:
+ cur['absolute_url'] += '&' + cgi.escape(i) + '=' + cgi.escape(params[i])
+
ret['children'] = temp
return ret
@@ -591,7 +598,7 @@
def createSystem(self, host, passwd):
try:
exists = self.restrictedTraverse(PLONE_ROOT +'/systems/storage/' + host)
- return 'Storage system \"' + host + '\" is already managed.'
+ return 'Storage system \"' + host + '\" is already managed.'
except:
pass
@@ -617,7 +624,7 @@
try:
exists = self.restrictedTraverse(PLONE_ROOT +'/systems/storage/' + host)
- return 'Storage system \"' + host + '\" is already managed.'
+ return 'Storage system \"' + host + '\" is already managed.'
except:
pass
@@ -696,7 +703,7 @@
# host = rhost
cluster_info = rc.cluster_info()
- if len(cluster_info) > 0 and cluster_info[0] != '' and cluster_info[0] != cluster:
+ if len(cluster_info) > 0 and cluster_info[0] != '' and cluster_info[0] != cluster:
return 'The host \"' + host + '\" is already a member of the cluster \"' + cluster_info[0] + '\"'
try:
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] conga/luci homebase/form-macros site/luci/Exte ...
@ 2006-07-31 17:46 rmccabe
0 siblings, 0 replies; 4+ messages in thread
From: rmccabe @ 2006-07-31 17:46 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-07-31 17:46:32
Modified files:
luci/homebase : form-macros
luci/site/luci/Extensions: cluster_adapters.py
Log message:
cluster add bits.. been sitting here unchecked in for too long
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.23&r2=1.24
--- conga/luci/homebase/form-macros 2006/07/25 17:47:36 1.31
+++ conga/luci/homebase/form-macros 2006/07/31 17:46:32 1.32
@@ -1,7 +1,7 @@
<html>
<tal:comment replace="nothing">
- $Id: form-macros,v 1.31 2006/07/25 17:47:36 rmccabe Exp $
+ $Id: form-macros,v 1.32 2006/07/31 17:46:32 rmccabe Exp $
</tal:comment>
<head>
@@ -336,7 +336,7 @@
</tal:block>
<div tal:omit-tag="" tal:condition="python: systems[1] and len(systems[1]) > 0">
- <h3 class="homebase">Unclustered Systems</h3>
+ <h3 class="homebase">Storage Systems</h3>
<tal:block tal:repeat="s python: systems[1]">
<div class="hbcheckdiv"
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/07/28 19:03:05 1.23
+++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/07/31 17:46:32 1.24
@@ -25,17 +25,15 @@
CLUSTER_FOLDER_PATH = '/luci/systems/cluster/'
-def validateCreateCluster(self, request):
- errors = list()
- messages = list()
+def validateClusterNodes(request, sessionData, numStorage):
nodeList = list()
nodeHash = {}
rnodeHash = {}
oldNodeHash = {}
oldRnodeHash = {}
requestResults = {}
+ errors = list()
- sessionData = request.SESSION.get('checkRet')
if sessionData and 'requestResults' in sessionData:
requestResults = sessionData['requestResults']
if 'nodeHash' in requestResults:
@@ -43,18 +41,6 @@
if 'rnodeHash' in requestResults:
oldRnodeHash = requestResults['rnodeHash']
- if not 'clusterName' in request.form or not request.form['clusterName']:
- return (False, {'errors': [ 'No cluster name was specified.' ] })
- clusterName = request.form['clusterName']
-
- try:
- numStorage = int(request.form['numStorage'])
- except:
- return (False, { 'errors': ['Unknown number of systems entered'], 'requestResults': requestResults })
-
- if numStorage < 2:
- return (False, { 'errors': ['A cluster must contain at least two nodes'], 'requestResults': requestResults })
-
i = 0
while i < numStorage:
try:
@@ -95,9 +81,6 @@
nodeList.append(node)
i += 1
- if len(nodeList) < 2:
- errors.append('A cluster must contain at least two nodes')
-
sfn = lambda x, y: \
x['cur_auth'] - y['cur_auth'] or (('errors' in y) - ('errors' in x))
nodeList.sort(sfn)
@@ -111,6 +94,41 @@
'isComplete': len(errors) < 1 and len(filter(dfn, nodeList)) == 0
}
+ return [errors, cluster_properties]
+
+def validateCreateCluster(self, request):
+ errors = list()
+ messages = list()
+ requestResults = {}
+
+ try:
+ sessionData = request.SESSION.get('checkRet')
+ except:
+ sessionData = None
+
+ if not 'clusterName' in request.form or not request.form['clusterName']:
+ return (False, {'errors': [ 'No cluster name was specified.' ] })
+ clusterName = request.form['clusterName']
+
+ try:
+ numStorage = int(request.form['numStorage'])
+ except:
+ return (False, { 'errors': ['Unknown number of systems entered'], 'requestResults': requestResults })
+
+ if numStorage < 2:
+ return (False, { 'errors': ['A cluster must contain at least two nodes'], 'requestResults': requestResults })
+
+ ret = validateClusterNodes(request, sessionData, numStorage)
+ errors.extend(ret[0])
+ cluster_properties = ret[1]
+
+ try:
+ nodeList = cluster_properties['nodeList']
+ if len(nodeList) < 2:
+ raise
+ except:
+ errors.append('A cluster must contain at least two nodes')
+
if cluster_properties['isComplete'] != True:
nodeUnauth(nodeList)
return (False, {'errors': errors, 'requestResults':cluster_properties })
@@ -168,12 +186,53 @@
def validateAddClusterNode(self, request):
+ try:
+ sessionData = request.SESSION.get('checkRet')
+ except:
+ sessionData = None
+
if 'clusterName' in request.form:
clusterName = request.form['clusterName']
else:
return (False, {'errrors': [ 'Cluster name is missing'] })
- return None
+ try:
+ numStorage = int(request.form['numStorage'])
+ if numStorage < 1:
+ raise
+ except:
+ errors.append('You must specify at least one node to add to the cluster')
+ return (False, {'errors': [ errors ] })
+
+ ret = validateClusterNodes(sessionData, request, numStorage)
+ errors.extend(ret[0])
+ cluster_properties = ret[1]
+
+ try:
+ nodeList = cluster_properties['nodeList']
+ if len(nodeList) < 1:
+ raise
+ except:
+ errors.append('You must specify@least one valid node to add to the cluster')
+
+ if not cluster_properties['isComplete']:
+ return (False, {'errors': errors, 'requestResults': cluster_properties})
+
+ i = 0
+ while i < len(nodeList):
+ try:
+ x = 0 # ricci call succeeds
+ messages.append('Cluster join initiated for host \"' + i['ricci_host'] + '\"')
+ del nodeList[i]
+ except:
+ i['errors'] = True
+ errors.append('Unable to initiate node creation for host \"' + i['ricci_host'] + '\"')
+ cluster_properties['isComplete'] = 0
+
+ if not cluster_properties['isComplete']:
+ return (False, {'errors': errors, 'requestResults': cluster_properties})
+
+ return (True, {'errors': errors, 'messages': messages})
formValidators = {
6: validateCreateCluster,
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] conga/luci homebase/form-macros site/luci/Exte ...
@ 2006-10-13 17:04 rmccabe
0 siblings, 0 replies; 4+ messages in thread
From: rmccabe @ 2006-10-13 17:04 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-10-13 17:04:11
Modified files:
luci/homebase : form-macros
luci/site/luci/Extensions: homebase_adapters.py ricci_bridge.py
Log message:
fix for bz #209997
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_bridge.py.diff?cvsroot=cluster&r1=1.26&r2=1.27
--- conga/luci/homebase/form-macros 2006/10/09 16:16:11 1.39
+++ conga/luci/homebase/form-macros 2006/10/13 17:04:09 1.40
@@ -1,7 +1,7 @@
<html>
<tal:comment replace="nothing">
- $Id: form-macros,v 1.39 2006/10/09 16:16:11 rmccabe Exp $
+ $Id: form-macros,v 1.40 2006/10/13 17:04:09 rmccabe Exp $
</tal:comment>
<head>
@@ -482,19 +482,19 @@
set_page_title('Luci ??? homebase ??? Add a running cluster to be managed by Luci');
</script>
- <tal:block tal:omit-tag=""
- tal:define="global sessionObj python:request.SESSION.get('checkRet')" />
+ <tal:block tal:define="
+ global sessionObj python:request.SESSION.get('checkRet')" />
- <form name="adminform" action="" method="post">
+ <h2 class="homebase">Add Cluster</h2>
+
+ <form name="adminform" action="" method="post"
+ tal:condition="python: sessionObj and len(sessionObj)">
<input name="pagetype" type="hidden"
tal:attributes="value request/form/pagetype | request/pagetype | nothing" />
-
<input name="absoluteURL" type="hidden"
tal:attributes="value python:data['children'][data['curIndex']]['absolute_url']" />
- <h2 class="homebase">Add Cluster</h2>
-
<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
<thead class="systemsTable">
<tr class="systemsTable"><td class="systemsTable" colspan="2">
@@ -511,10 +511,11 @@
<tfoot class="systemsTable">
<tr class="systemsTable"><td colspan="2" class="systemsTable">
- <div tal:condition="python: not sessionObj['requestResults']['isComplete']">
+ <div tal:condition="python: not 'isComplete' in sessionObj['requestResults'] or not sessionObj['requestResults']['isComplete']">
<input type="checkbox" name="allSameCheckBox" id="allSameCheckBox" onClick="allPasswdsSame(adminform);"/> Check if storage system passwords are identical.
</div>
- <div class="systemsTable" tal:condition="python: sessionObj['requestResults']['isComplete']"> </div>
+ <div class="systemsTable"
+ tal:condition="python: 'isComplete' in sessionObj['requestResults'] and sessionObj['requestResults']['isComplete']"> </div>
</td></tr>
</tfoot>
@@ -522,7 +523,7 @@
tal:define="global sysNum python: 0"
/>
- <tbody class="systemsTable">
+ <tbody class="systemsTable" tal:condition="python: 'nodeList' in sessionObj['requestResults']">
<tal:block tal:repeat="node python: sessionObj['requestResults']['nodeList']">
<span tal:omit-tag=""
tal:define="global nodeAuth python: node['cur_auth']" />
@@ -564,6 +565,13 @@
<input type="button" name="Submit" value="Add This Cluster" onClick="validateForm(document.adminform);" />
</div>
</form>
+
+ <div tal:condition="python: not sessionObj or not len(sessionObj)">
+ <span class="error">
+ A data integrity error has occurred. Please attempt to add this cluster to the Luci management interface again.
+ </span>
+ <tal:block tal:define="nop python:here.abortManageCluster(request)" />
+ </div>
</div>
--- conga/luci/site/luci/Extensions/homebase_adapters.py 2006/10/12 19:40:44 1.29
+++ conga/luci/site/luci/Extensions/homebase_adapters.py 2006/10/13 17:04:11 1.30
@@ -300,15 +300,38 @@
clusterName = request.form['clusterName']
except:
clusterName = ''
- return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName } })
+
+ try:
+ nodeList = requestResults['nodeList']
+ nodeUnauth(nodeList)
+ except:
+ pass
+
+ return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'isComplete': False, 'nodeList': [] } })
- if not 'clusterName' in request.form or request.form['clusterName'] == '':
- return (False, { 'errors': ['No cluster name given'], 'requestResults': requestResults })
+ try:
+ clusterName = request.form['clusterName']
+ if not clusterName:
+ raise
+ except:
+ return (False, { 'errors': ['No cluster name was given.'], 'requestResults': requestResults })
+
+ try:
+ nodeList = requestResults['nodeList']
+ if not nodeList or len(nodeList) < 1:
+ raise
+ except:
+ return (False, { 'errors': ['No cluster nodes were given.'], 'requestResults': requestResults })
- clusterName = request.form['clusterName']
- nodeList = requestResults['nodeList']
- nodeHash = requestResults['nodeHash']
- rnodeHash = requestResults['rnodeHash']
+ try:
+ nodeHash = requestResults['nodeHash']
+ except:
+ nodeHash = {}
+
+ try:
+ rnodeHash = requestResults['rnodeHash']
+ except:
+ rnodeHash = {}
# This should never fail
try:
@@ -317,6 +340,10 @@
raise
except:
nodeUnauth(nodeList)
+ try:
+ requestResults['isComplete'] = False
+ except:
+ pass
return (False, {
'errors': [ 'Unknown number of nodes entered' ],
'requestResults': requestResults })
@@ -345,7 +372,7 @@
if not oldNode:
nodeUnauth(nodeList)
- return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName } })
+ return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'nodeList': nodeList, 'isComplete': False } })
if oldNode['host'] != node['host']:
del nodeHash[oldNode['host']]
@@ -679,9 +706,9 @@
raise
if havePermAddCluster(self):
addCluster = {}
- addCluster['Title'] = 'Add a Cluster'
+ addCluster['Title'] = 'Add an Existing Cluster'
addCluster['absolute_url'] = url + '?pagetype=' + HOMEBASE_ADD_CLUSTER
- addCluster['Description'] = 'Add a cluster to the Luci cluster management interface.'
+ addCluster['Description'] = 'Add an existing cluster to the Luci cluster management interface.'
if pagetype == HOMEBASE_ADD_CLUSTER:
addCluster['currentItem'] = True
ret['curIndex'] = index
@@ -909,7 +936,8 @@
try:
sessionData = request.SESSION.get('checkRet')
nodeUnauth(sessionData['requestResults']['nodeList'])
- except: pass
+ except:
+ pass
def manageCluster(self, clusterName, nodeList):
clusterName = str(clusterName)
--- conga/luci/site/luci/Extensions/ricci_bridge.py 2006/10/12 22:41:27 1.26
+++ conga/luci/site/luci/Extensions/ricci_bridge.py 2006/10/13 17:04:11 1.27
@@ -13,7 +13,6 @@
def __init__(self, hostname, port=11111):
self.__hostname = hostname
self.__port = port
- return
def process(self, xml_out):
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] conga/luci homebase/form-macros site/luci/Exte ...
@ 2006-10-31 19:09 rmccabe
0 siblings, 0 replies; 4+ messages in thread
From: rmccabe @ 2006-10-31 19:09 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2006-10-31 19:09:28
Modified files:
luci/homebase : form-macros
luci/site/luci/Extensions: homebase_adapters.py
Log message:
back out patch that tried to address the memory use problems
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.44.2.1&r2=1.44.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.34.2.3&r2=1.34.2.4
--- conga/luci/homebase/form-macros 2006/10/31 17:28:04 1.44.2.1
+++ conga/luci/homebase/form-macros 2006/10/31 19:09:25 1.44.2.2
@@ -1,7 +1,7 @@
<html>
<tal:comment tal:replace="nothing">
- $Id: form-macros,v 1.44.2.1 2006/10/31 17:28:04 rmccabe Exp $
+ $Id: form-macros,v 1.44.2.2 2006/10/31 19:09:25 rmccabe Exp $
</tal:comment>
<head>
@@ -554,11 +554,8 @@
set_page_title('Luci ??? homebase ??? Add a running cluster to be managed by Luci');
</script>
- <tal:block tal:condition="python: request.SESSION.has_key('checkRet')"
- tal:define="global sessionObj python:request.SESSION.get('checkRet')" />
-
- <tal:block tal:condition="python: not request.SESSION.has_key('checkRet')"
- tal:define="global sessionObj python:{}" />
+ <tal:block tal:define="
+ global sessionObj python:request.SESSION.get('checkRet')" />
<h2 class="homebase">Add Cluster</h2>
--- conga/luci/site/luci/Extensions/homebase_adapters.py 2006/10/31 17:28:04 1.34.2.3
+++ conga/luci/site/luci/Extensions/homebase_adapters.py 2006/10/31 19:09:27 1.34.2.4
@@ -13,6 +13,15 @@
from ricci_communicator import CERTS_DIR_PATH
from clusterOS import resolveOSType
from conga_constants import *
+from LuciSyslog import LuciSyslog, LuciSyslogError
+
+try:
+ luci_log = LuciSyslog()
+except LuciSyslogError, e:
+ pass
+
+class InCluster(Exception):
+ pass
def siteIsSetup(self):
try:
@@ -296,7 +305,8 @@
try:
sessionData = request.SESSION.get('checkRet')
requestResults = sessionData['requestResults']
- except:
+ except Exception, e:
+ luci_log.debug_verbose('VAC0: error getting session obj: %s' % str(e))
try:
clusterName = request.form['clusterName']
except:
@@ -304,24 +314,27 @@
try:
nodeList = requestResults['nodeList']
+ luci_log.debug_verbose('VAC1: unauth to node list')
nodeUnauth(nodeList)
except:
pass
- return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'isComplete': False, 'nodeList': [] } })
+ return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'isComplete': False, 'nodeList': [], 'redirect': HOMEBASE_ADD_CLUSTER_INITIAL } })
try:
clusterName = request.form['clusterName']
if not clusterName:
- raise
- except:
+ raise Exception, 'no cluster name was found'
+ except Exception, e:
+ luci_log.debug_verbose('VAC2: no cluser name found: %s', str(e))
return (False, { 'errors': ['No cluster name was given.'], 'requestResults': requestResults })
try:
nodeList = requestResults['nodeList']
if not nodeList or len(nodeList) < 1:
- raise
- except:
+ raise Exception, 'no node list found'
+ except Exception, e:
+ luci_log.debug_verbose('VAC3: no nodeList found: %s', str(e))
return (False, { 'errors': ['No cluster nodes were given.'], 'requestResults': requestResults })
try:
@@ -338,13 +351,15 @@
try:
numStorage = int(request.form['numStorage'])
if numStorage != len(nodeList):
- raise
- except:
- nodeUnauth(nodeList)
+ raise Exception, 'numstorage != len(nodelist)'
+ except Exception, e:
try:
requestResults['isComplete'] = False
+ luci_log.debug_verbose('VAC4: error: %s' % str(e))
except:
pass
+
+ nodeUnauth(nodeList)
return (False, {
'errors': [ 'Unknown number of nodes entered' ],
'requestResults': requestResults })
@@ -372,8 +387,9 @@
oldNode = rnodeHash[k]
if not oldNode:
+ luci_log.debug_verbose('VAC5: node %s not found', sysData[0])
nodeUnauth(nodeList)
- return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'nodeList': nodeList, 'isComplete': False } })
+ return (False, { 'errors': [ 'A data integrity error has occurred. Please attempt adding the cluster again.' ], 'requestResults': { 'clusterName': clusterName, 'nodeList': nodeList, 'isComplete': False, 'redirect': HOMEBASE_ADD_CLUSTER_INITIAL } })
if oldNode['host'] != node['host']:
del nodeHash[oldNode['host']]
@@ -658,20 +674,23 @@
except:
sessionData = None
- try:
- request.SESSION.delete('checkRet')
- except:
- pass
-
if 'ACTUAL_URL' in request:
url = request['ACTUAL_URL']
else:
url = '.'
- try:
+ if 'pagetype' in request.form:
pagetype = int(request.form['pagetype'])
+ else:
+ try: request.SESSION.set('checkRet', {})
+ except: pass
+ return homebasePortal(self, request, '.', '0')
+
+ try:
validatorFn = formValidators[pagetype - 1]
except:
+ try: request.SESSION.set('checkRet', {})
+ except: pass
return homebasePortal(self, request, '.', '0')
if validatorFn == validateAddClusterInitial or validatorFn == validateAddCluster:
@@ -699,7 +718,7 @@
return homebaseControlPost(self, request)
try:
- request.SESSION.delete('checkRet')
+ request.SESSION.set('checkRet', {})
except:
pass
@@ -1003,6 +1022,7 @@
def manageCluster(self, clusterName, nodeList):
clusterName = str(clusterName)
+ luci_log.debug_verbose('manageCluster for %s' % clusterName)
try:
clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/')
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-10-31 19:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-30 21:39 [Cluster-devel] conga/luci homebase/form-macros site/luci/Exte rmccabe
-- strict thread matches above, loose matches on Subject: below --
2006-07-31 17:46 rmccabe
2006-10-13 17:04 rmccabe
2006-10-31 19:09 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).