From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 21 Jul 2006 14:49:48 -0000 Subject: [Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ... Message-ID: <20060721144948.18252.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: rmccabe at sourceware.org 2006-07-21 14:49:47 Modified files: luci/cluster : form-macros luci/site/luci/Extensions: cluster_adapters.py Log message: commiting cluster add node bits before somebody else commits and causes rejects :) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.7&r2=1.8 --- conga/luci/cluster/form-macros 2006/07/20 16:59:33 1.6 +++ conga/luci/cluster/form-macros 2006/07/21 14:49:46 1.7 @@ -22,6 +22,7 @@ +
@@ -65,12 +66,12 @@
+

Cluster Form

-
@@ -153,7 +154,8 @@
Cluster Name: - +
@@ -175,9 +177,7 @@ - + @@ -202,19 +202,16 @@ value python: nodeAuth and '[authenticated]' or ''; class python: 'hbInputPass' + ('errors' in node and ' error' or ''); id python: '__SYSTEM' + str(sysNum) + ':Passwd'; - name python: '__SYSTEM' + str(sysNum) + ':Passwd'; + name python: '__SYSTEM' + str(sysNum) + ':Passwd'" /> - + + -
@@ -338,8 +335,13 @@ + +
- + +

Add a Node to a Cluster

@@ -347,10 +349,7 @@
- Cluster Name - + Cluster Name
@@ -362,7 +361,9 @@
- Check if cluster node passwords are identical. + + Check if cluster node passwords are identical.
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/07/20 16:59:33 1.7 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/07/21 14:49:47 1.8 @@ -18,10 +18,7 @@ CLUSTER_FOLDER_PATH = '/luci/systems/cluster/' -def validatePost(self, request): - if int(request.form['pagetype']) != 6: - return - +def validateCreateCluster(self, request): errors = list() messages = list() nodeList = list() @@ -141,6 +138,27 @@ messages.append('Creation of cluster \"' + clusterName + '\" has begun') return (True, {'errors': errors, 'messages': messages }) +def validateAddClusterNode(self, request): + if 'clusterName' in request.form: + clusterName = request.form['clusterName'] + else: + return (False, {'errrors': [ 'Cluster name is missing'] }) + + return None + +formValidator = { + 6: validateCreateCluster, + 15: validateAddClusterNode +} + +def validatePost(self, request): + pagetype = int(request.form['pagetype']) + if not pagetype in formValidators: + return None + else: + return formValidators[pagetype](self, request) + + def createCluChooser(self, request, systems): dummynode = {}