cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ...
Date: 21 Jul 2006 14:49:48 -0000	[thread overview]
Message-ID: <20060721144948.18252.qmail@sourceware.org> (raw)

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 @@
    </table>
     
   </div>
+
   <div metal:define-macro="clusters-form">
      <table>
       <tbody>
@@ -65,12 +66,12 @@
       </tbody>
      </table>
   </div>
+
   <div metal:define-macro="cluster-form">
    <h2>Cluster Form</h2>
   </div>
 
 
-
   <div metal:define-macro="clusteradd-form" style="margin-left: 1em">
 	<script type="text/javascript" src="/luci/homebase/homebase_common.js">
 	</script>
@@ -153,7 +154,8 @@
 				<tr class="systemsTable"><td class="systemsTable" colspan="2">
 					<div class="systemsTableTop">
 						<strong>Cluster Name:</strong>
-						<input type="text" id="clusterName" name="clusterName" tal:attributes="value python: sessionObj['requestResults']['clusterName']" />
+						<input type="text" id="clusterName" name="clusterName"
+							tal:attributes="value python: sessionObj['requestResults']['clusterName']" />
 					</div>
 				</td></tr>
 				<tr class="systemsTable">
@@ -175,9 +177,7 @@
 				</td></tr>
 			</tfoot>
 
-			<span tal:omit-tag=""
-				tal:define="global sysNum python: 0"
-			/>
+			<span tal:omit-tag="" tal:define="global sysNum python: 0" />
 
 			<tbody class="systemsTable">
 			<tal:block tal:repeat="node python: sessionObj['requestResults']['nodeList']">
@@ -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'"
 						/>
 					</td>
 				</tr>
-				<span tal:omit-tag=""
-					tal:define="global sysNum python: sysNum + 1"
-				/>
+				<span tal:omit-tag="" tal:define="global sysNum python: sysNum + 1" />
 			</tal:block>
 			</tbody>
 		</table>
+		<input type="hidden" name="numStorage" tal:attributes="value python: sysNum" />
 
-		<input type="hidden" name="numStorage"
-			tal:attributes="value python: sysNum" />
 		</tal:block>
 
 		<div class="hbSubmit" id="hbSubmit">
@@ -338,8 +335,13 @@
 	<script type="text/javascript" src="/luci/homebase/validate_cluster_add.js">
 	</script>
 
+	<input type="hidden" name="clusterName"
+		tal:attributes="value request/form/clusterName | request/clustername | none"
+	/>
+
 	<form name="adminform" action="" method="post">
-		<input name="numStorage" id="numStorage" type="hidden" value="0" />
+		<input name="numStorage" type="hidden" value="1" />
+		<input name="pagetype" type="hidden" value="15" />
 
 		<h2>Add a Node to a Cluster</h2>
 
@@ -347,10 +349,7 @@
 			<thead class="systemsTable">
 				<tr class="systemsTable"><td class="systemsTable" colspan="2">
 					<div class="systemsTableTop">
-						<strong>Cluster Name</strong>
-						<select class="hbInputSys" id="clusterName" name="clusterList">
-							<option>Fill this in</option>
-						</select>
+						<strong>Cluster Name</strong> <span tal:content="request/form/clusterName | request/clustername | none" />
 					</div>
 				</td></tr>
 				<tr class="systemsTable">
@@ -362,7 +361,9 @@
 			<tfoot class="systemsTable">
 				<tr class="systemsTable"><td colspan="2" class="systemsTable">
 					<div id="allSameDiv">
-						<input type="checkbox" class="allSameCheckBox" name="allSameCheckBox" id="allSameCheckBox" onClick="allPasswdsSame(adminform);"/> Check if cluster node passwords are identical.
+						<input type="checkbox" class="allSameCheckBox"
+							name="allSameCheckBox" id="allSameCheckBox" onClick="allPasswdsSame(adminform);"/>
+						Check if cluster node passwords are identical.
 					</div>
 				</td></tr>
 
--- 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 = {}
   



             reply	other threads:[~2006-07-21 14:49 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-21 14:49 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-09-21  3:11 [Cluster-devel] conga/luci cluster/form-macros site/luci/Exten rmccabe
2007-06-19 15:54 rmccabe
2007-05-03 20:16 rmccabe
2007-03-15 16:41 rmccabe
2007-03-14 22:38 rmccabe
2007-03-14 22:37 rmccabe
2007-03-05 16:50 rmccabe
2007-03-05 16:50 rmccabe
2007-03-05 16:49 rmccabe
2007-02-15 22:44 rmccabe
2007-02-08  3:46 rmccabe
2007-02-07 17:02 rmccabe
2007-02-07 16:55 rmccabe
2007-02-02  4:34 rmccabe
2007-02-02  0:11 rmccabe
2007-02-01 20:49 rmccabe
2007-01-31 23:36 rmccabe
2007-01-31  5:26 rmccabe
2007-01-23 13:53 rmccabe
2007-01-15 18:21 rmccabe
2007-01-11 19:11 rmccabe
2007-01-10 21:40 rmccabe
2007-01-06  3:29 rmccabe
2006-12-14 23:14 rmccabe
2006-12-14 18:22 rmccabe
2006-12-11 22:42 rmccabe
2006-12-11 21:51 rmccabe
2006-12-06 22:11 rmccabe
2006-12-06 21:16 rmccabe
2006-11-13 21:40 rmccabe
2006-11-12  2:10 rmccabe
2006-11-09 20:32 rmccabe
2006-11-03 22:48 rmccabe
2006-10-25  1:53 rmccabe
2006-10-25  1:11 rmccabe
2006-10-13 21:25 rmccabe
2006-08-03 18:36 shuennek
2006-07-20 16:59 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=20060721144948.18252.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 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).