Skip to contentSkip to conversation

conga/luci cluster/form-macros cluster/validat ...

Cluster-devel [email protected] 1 participant 1 message Feb 16, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2007-02-16 05:29:38

Modified files:
luci/cluster : form-macros validate_config_qdisk.js
luci/site/luci/Extensions: cluster_adapters.py

Log message:
- Only set the totem params cman actually reads
- Fix a bunch of bugs relating to qdisk properties

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.176.2.11&r2=1.176.2.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_qdisk.js.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.227.2.8&r2=1.227.2.9

luci/cluster/form-macros +77 -82
@@ -640,12 +640,56 @@
 					<table class="systemsTable">
 						<tr class="systemsTable">
 							<td class="systemsTable">
+								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#token', 55, 65);">Token Timeout</a> (ms)
+							</td>
+							<td class="systemsTable">
+								<input type="text" size="10" name="token"
+									tal:attributes="value clusterinfo/totem/token | string:10000" />
+							</td>
+						</tr>
+
+						<tr class="systemsTable">
+							<td class="systemsTable">
+								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#retransmits_before_loss', 55, 65);">Number of token retransmits before loss</a>
+							</td>
+							<td class="systemsTable">
+								<input type="text" size="10"
+									name="token_retransmits_before_loss_const"
+									tal:attributes="value clusterinfo/totem/token_retransmits_before_loss_const | string:20" />
+							</td>
+						</tr>
+
+						<tr class="systemsTable">
+							<td class="systemsTable">
+								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#join', 55, 65);">Join Timeout</a> (ms)
+							</td>
+							<td class="systemsTable">
+								<input type="text" size="10" name="join"
+									tal:attributes="value clusterinfo/totem/join | string:60" />
+							</td>
+						</tr>
+
+						<tr class="systemsTable">
+							<td class="systemsTable">
+								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#consensus', 55, 65);">Consensus Timeout</a> (ms)
+							</td>
+							<td class="systemsTable">
+								<input type="text" size="10"
+									name="consensus"
+									tal:attributes="value clusterinfo/totem/consensus | string:4800" />
+							</td>
+						</tr>
+
+<tal:comment tal:replace="nothing">
+						<tr class="systemsTable">
+							<td class="systemsTable">
 								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#secauth', 55, 65);">Secure Authentication</a>
 							</td>
 							<td class="systemsTable">
 								<input type="checkbox" name="secauth" checked="checked" />
 						</tr>
 
+
 						<tr class="systemsTable">
 							<td class="systemsTable">
 								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#rrp_mode', 55, 65);">Redundant Ring Protocol Mode</a>
@@ -703,16 +747,6 @@
 
 						<tr class="systemsTable">
 							<td class="systemsTable">
-								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#token', 55, 65);">Token Timeout</a> (ms)
-							</td>
-							<td class="systemsTable">
-								<input type="text" size="10" name="token"
-									tal:attributes="value string:5000" />
-							</td>
-						</tr>
-
-						<tr class="systemsTable">
-							<td class="systemsTable">
 								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#token_retransmit', 55, 65);">Token Retransmit</a> (ms)
 							</td>
 							<td class="systemsTable">
@@ -734,27 +768,6 @@
 
 						<tr class="systemsTable">
 							<td class="systemsTable">
-								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#retransmits_before_loss', 55, 65);">Number of retransmits before loss</a>
-							</td>
-							<td class="systemsTable">
-								<input type="text" size="10"
-									name="retransmits_before_loss"
-									tal:attributes="value string:4" />
-							</td>
-						</tr>
-
-						<tr class="systemsTable">
-							<td class="systemsTable">
-								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#join', 55, 65);">Join Timeout</a> (ms)
-							</td>
-							<td class="systemsTable">
-								<input type="text" size="10" name="join"
-									tal:attributes="value string:100" />
-							</td>
-						</tr>
-
-						<tr class="systemsTable">
-							<td class="systemsTable">
 								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#send_join', 55, 65);">Maximum time to wait before sending a join message</a> (ms)
 							</td>
 							<td class="systemsTable">
@@ -765,17 +778,6 @@
 
 						<tr class="systemsTable">
 							<td class="systemsTable">
-								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#consensus', 55, 65);">Consensus Timeout</a> (ms)
-							</td>
-							<td class="systemsTable">
-								<input type="text" size="10"
-									name="consensus"
-									tal:attributes="value string:100" />
-							</td>
-						</tr>
-
-						<tr class="systemsTable">
-							<td class="systemsTable">
 								<a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#merge', 55, 65);">Merge Detection Timeout</a> (ms)
 							</td>
 							<td class="systemsTable">
@@ -894,6 +896,7 @@
 									tal:attributes="value string:47" />
 							</td>
 						</tr>
+</tal:comment>
 					</table>
 				</td></tr>
 			</table>
@@ -1092,14 +1095,14 @@
 				<tr class="systemsTable" id="st_row"><td class="systemsTable" id="st_col">
 					<input type="radio" name="quorumd" value="False"
 						onClick="disableChildrenInput('quorumdisk');"
-						tal:attributes="checked python: clusterinfo['is_quorumd'] != 'True'"/>
+						tal:attributes="checked python: (not clusterinfo['is_quorumd']) and 'checked' or ''" />
 					Do not use a Quorum Partition
 				</td></tr>
 
 				<tr class="systemsTable"><td class="systemsTable">
 					<input type="radio" name="quorumd" value="True"
 						onClick="enableChildrenInput('quorumdisk');"
-						tal:attributes="checked python: clusterinfo['is_quorumd'] == 'True'"/>
+						tal:attributes="checked python: (clusterinfo['is_quorumd']) and 'checked' or ''" />
 						Use a Quorum Partition
 				</td></tr>
 			</tbody>
@@ -1114,48 +1117,48 @@
 			<tr class="systemsTable">
 				<td class="systemsTable">Interval</td>
 				<td class="systemsTable">
-					<input type="text" name="interval" value=""
-						tal:attributes="value clusterinfo/interval"/>
+					<input type="text" name="interval"
+						tal:attributes="value clusterinfo/interval | nothing" />
 				</td>
 			</tr>
 
 			<tr class="systemsTable">
 				<td class="systemsTable">Votes</td>
 				<td class="systemsTable">
-					<input type="text" name="votes" value=""
-						tal:attributes="value clusterinfo/votes"/>
+					<input type="text" name="votes"
+						tal:attributes="value clusterinfo/votes | nothing" />
 				</td>
 			</tr>
 
 			<tr class="systemsTable">
 				<td class="systemsTable">TKO</td>
 				<td class="systemsTable">
-					<input type="text" name="tko" value=""
-						tal:attributes="value clusterinfo/tko"/>
+					<input type="text" name="tko"
+						tal:attributes="value clusterinfo/tko | nothing" />
 				</td>
 			</tr>
 
 			<tr class="systemsTable">
 				<td class="systemsTable">Minimum Score</td>
 				<td class="systemsTable">
-					<input type="text" name="min_score" value=""
-						tal:attributes="value clusterinfo/min_score"/>
+					<input type="text" name="min_score"
+						tal:attributes="value clusterinfo/min_score | nothing" />
 				</td>
 			</tr>
 
 			<tr class="systemsTable">
 				<td class="systemsTable">Device</td>
 				<td class="systemsTable">
-					<input type="text" name="device" value=""
-						tal:attributes="value clusterinfo/device"/>
+					<input type="text" name="device"
+						tal:attributes="value clusterinfo/device | nothing" />
 				</td>
 			</tr>
 
 			<tr class="systemsTable">
 				<td class="systemsTable">Label</td>
 				<td class="systemsTable">
-					<input type="text" name="label" value=""
-						tal:attributes="value clusterinfo/label"/>
+					<input type="text" name="label"
+						tal:attributes="value clusterinfo/label | nothing" />
 				</td>
 			</tr>
 		</table>
@@ -1172,9 +1175,6 @@
 
 				<tr class="systemsTable">
 					<th class="systemsTable">
-						<div class="systemsTableTop">Name</div>
-					</th>
-					<th class="systemsTable">
 						<div class="systemsTableTop">Path to Program</div>
 					</th>
 					<th class="systemsTable">
@@ -1190,22 +1190,22 @@
 			</thead>
 
 			<tbody class="systemsTable" id="heuristicList"
-				tal:define="global heuristics clusterinfo/hlist">
+				tal:define="global heuristics clusterinfo/hlist | nothing">
 
-				<tal:block tal:condition="python: not len(heuristics)">
+				<tal:block tal:condition="python: not heuristics or not len(heuristics)">
 				<input type="hidden" name="num_heuristics" id="num_heuristics" value="0">
 				<tr class="systemsTable" id="heuristic0">
 					<td class="systemsTable">
-						<input class="qdname qdisk" type="text" name="heuristic0:hname" id="heuristic0:hname" value="">
-					</td>
-					<td class="systemsTable">
-						<input class="qdpath qdisk" type="text" name="heuristic0:hprog" id="heuristic0:hprog" value="">
+						<input class="qdpath qdisk" type="text"
+							name="heuristic0:hprog" id="heuristic0:hprog" />
 					</td>
 					<td class="systemsTable">
-						<input class="qdint qdisk" type="text" name="heuristic0:hinterval" id="heuristic0:hinterval" value="">
+						<input class="qdint qdisk" type="text"
+							name="heuristic0:hinterval" id="heuristic0:hinterval" />
 					</td>
 					<td class="systemsTable">
-						<input class="qdscore qdisk" type="text" name="heuristic0:hscore" id="heuristic0:hscore" value="">
+						<input class="qdscore qdisk" type="text"
+							name="heuristic0:hscore" id="heuristic0:hscore" />
 					</td>
 					<td class="systemsTable">
 						<img class="qdisk deleteRow"
@@ -1230,32 +1230,27 @@
 					tal:define="global curHeur python: curHeur + 1">
 
 					<td class="systemsTable">
-						<input class="qdname qdisk" type="text"
-							tal:attributes="
-								value heuristic/hname;
-								id python: 'heuristic' + str(curHeur) + ':hname';
-								name python: 'heuristic' + str(curHeur) + ':hname';"/>
-					</td>
-					<td class="systemsTable">
 						<input class="qdpath qdisk" type="text"
 							tal:attributes="
 								value heuristic/hprog;
 								id python: 'heuristic' + str(curHeur) + ':hprog';
-								name python: 'heuristic' + str(curHeur) + ':hprog';"/>
+								name python: 'heuristic' + str(curHeur) + ':hprog'" />
 					</td>
+
 					<td class="systemsTable">
 						<input class="qdint qdisk" type="text"
 							tal:attributes="
 								value heuristic/hinterval;
 								id python: 'heuristic' + str(curHeur) + ':hinterval';
-								name python: 'heuristic' + str(curHeur) + ':hinterval';"/>
+								name python: 'heuristic' + str(curHeur) + ':hinterval'" />
 					</td>
+
 					<td class="systemsTable">
 						<input class="qdscore qdisk" type="text"
 							tal:attributes="
 								value heuristic/hscore;
 								id python: 'heuristic' + str(curHeur) + ':hscore';
-								name python: 'heuristic' + str(curHeur) + ':hscore';"/>
+								name python: 'heuristic' + str(curHeur) + ':hscore'" />
 					</td>
 					<td class="systemsTable">
 						<img class="qdisk deleteRow"
@@ -1264,14 +1259,15 @@
 							onClick="delete_qdisk_heur(this, document.quorum_partition);"
 							tal:attributes="
 								id python: 'heuristic' + str(curHeur) + ':hdel';
-								name python: 'heuristic' + str(curHeur) + ':hdel';"/>
+								name python: 'heuristic' + str(curHeur) + ':hdel'" />
 					</td>
 				</tr>
 				</tal:block>
 			</tbody>
+
 			<tfoot>
 				<tr class="systemsTable"><td class="systemsTable">
-					<input class="addrow" type="button" value="Add another heuristic" onClick="addHeuristic('heuristicList');">
+					<input class="addrow" type="button" value="Add another heuristic" onClick="addHeuristic('heuristicList')">
 				</td></tr>
 			</tfoot>
 		</table>
@@ -1281,10 +1277,9 @@
 		<div class="spacing configTabContent"></div>
 		<div class="hbSubmit spacing configTabContent">
 			<input type="button" value="Apply"
-				onClick="validate_form(this.form);"
-			>
+				onClick="validate_form(this.form)" />
 		</div>
-		<script tal:condition="python: clusterinfo['is_quorumd'] != 'True'">
+		<script tal:condition="not: clusterinfo/is_quorumd">
 			disableChildrenInput('quorumdisk');
 		</script>
 		</form>
luci/cluster/validate_config_qdisk.js +16 -55

130 lines not on this page · raw message

luci/site/luci/Extensions/cluster_adapters.py +80 -360

556 lines not on this page · raw message