* [Cluster-devel] conga/luci cluster/cluster_config-macros clust ...
@ 2008-01-02 17:36 rmccabe
0 siblings, 0 replies; 3+ messages in thread
From: rmccabe @ 2008-01-02 17:36 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-01-02 17:36:52
Modified files:
luci/cluster : cluster_config-macros validate_config_fence.js
validate_config_general.js
validate_config_gulm.js
validate_config_multicast.js
validate_config_qdisk.js
luci/plone-custom: conga.js luci.css
Log message:
Fix display issues with the cluster properties dialog on some browsers
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_config-macros.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_fence.js.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_general.js.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_gulm.js.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_multicast.js.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_qdisk.js.diff?cvsroot=cluster&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/conga.js.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/luci.css.diff?cvsroot=cluster&r1=1.2&r2=1.3
--- conga/luci/cluster/cluster_config-macros 2007/11/19 18:22:48 1.1
+++ conga/luci/cluster/cluster_config-macros 2008/01/02 17:36:52 1.2
@@ -18,6 +18,8 @@
<div metal:define-macro="clusterconfig-form">
<script type="text/javascript">
set_page_title('Luci ??? cluster ??? Configure cluster properties');
+ var active_tab = 'configtab1';
+ var cur_label_elem = null;
</script>
<script type="text/javascript"
src="conga_ajax.js">
@@ -37,49 +39,52 @@
tal:define="global clusterinfo python: here.getClusterInfo(modelb, request)" />
<tal:block tal:condition="clusterinfo">
+ <script type="text/javascript"
+ src="/luci/homebase/homebase_common.js">
+ </script>
+
<span tal:omit-tag="" tal:define="global configTabNum python: 'tab' in request and int(request['tab']) or 1" />
+ <div class="configTab">
<ul class="configTab">
<li class="configTab">
- <a tal:attributes="
- href clusterinfo/basecluster_url | nothing;
- class python: 'configTab' + (configTabNum == 1 and ' configTabActive' or '');
- ">General</a>
+ <a id="configtab1_label" onclick="active_tab=swap_tabs(this, active_tab, 'configtab1')"
+ tal:attributes="
+ class python: 'configTab' + (configTabNum == 1 and ' configTabActive' or '')">General</a>
</li>
+
<li class="configTab"
tal:condition="not:clusterinfo/gulm">
- <a tal:attributes="
- href clusterinfo/fencedaemon_url | nothing;
- class python: 'configTab' + (configTabNum == 2 and ' configTabActive' or '');
- ">Fence</a>
+ <a id="configtab2_label" onclick="active_tab=swap_tabs(this, active_tab, 'configtab2')"
+ tal:attributes="
+ class python: 'configTab' + (configTabNum == 2 and ' configTabActive' or '')">Fence</a>
</li>
+
<li class="configTab"
tal:condition="not:clusterinfo/gulm">
- <a tal:attributes="
- href clusterinfo/multicast_url | nothing;
- class python: 'configTab' + (configTabNum == 3 and ' configTabActive' or '');
- ">Multicast</a>
+ <a id="configtab3_label" onclick="active_tab=swap_tabs(this, active_tab, 'configtab3')"
+ tal:attributes="
+ class python: 'configTab' + (configTabNum == 3 and ' configTabActive' or '')">Multicast</a>
</li>
<li class="configTab"
tal:condition="clusterinfo/gulm">
- <a tal:attributes="
- href clusterinfo/gulm_url | nothing;
- class python: 'configTab' + (configTabNum == 5 and ' configTabActive' or '')">GULM</a>
+ <a id="configtab5_label" onclick="active_tab=swap_tabs(this, active_tab, 'configtab5')"
+ tal:attributes="
+ class python: 'configTab' + (configTabNum == 5 and ' configTabActive' or '')">GULM</a>
</li>
- <li class="configTab">
- <a tal:attributes="
- href clusterinfo/quorumd_url | nothing;
- class python: 'configTab' + (configTabNum == 4 and ' configTabActive' or '');
- ">Quorum Partition</a>
+ <li class="configTab"
+ tal:condition="not:clusterinfo/gulm">
+ <a id="configtab4_label" onclick="active_tab=swap_tabs(this, active_tab, 'configtab4')"
+ tal:attributes="
+ class python: 'configTab' + (configTabNum == 4 and ' configTabActive' or '')">Quorum Partition</a>
</li>
</ul>
+ </div>
- <div id="configTabContent" tal:condition="python: configTabNum == 1">
- <script type="text/javascript"
- src="/luci/homebase/homebase_common.js">
- </script>
+ <div id="configtab1"
+ tal:attributes="class python:'configTabMainContent ' + (configTabNum == 1 and ' ' or 'invisible')">
<script type="text/javascript"
src="/luci/cluster/validate_config_general.js">
</script>
@@ -136,7 +141,7 @@
<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)
+ <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"
@@ -146,7 +151,7 @@
<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>
+ <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"
@@ -157,7 +162,7 @@
<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)
+ <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"
@@ -167,7 +172,7 @@
<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)
+ <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"
@@ -179,7 +184,7 @@
<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>
+ <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" />
@@ -188,7 +193,7 @@
<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>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#rrp_mode', 55, 65)">Redundant Ring Protocol Mode</a>
</td>
<td class="systemsTable">
<select type="text" name="rrp_mode">
@@ -207,7 +212,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#netmtu', 55, 65);">Network MTU</a>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#netmtu', 55, 65)">Network MTU</a>
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -218,7 +223,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#threads', 55, 65);">Number of Threads
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#threads', 55, 65)">Number of Threads
</td>
<td class="systemsTable">
<input type="text" size="10" name="threads"
@@ -228,7 +233,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#vsftype', 55, 65);">Virtual Synchrony Type
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#vsftype', 55, 65)">Virtual Synchrony Type
</td>
<td class="systemsTable">
<select name="vsftype">
@@ -243,7 +248,7 @@
<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)
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#token_retransmit', 55, 65)">Token Retransmit</a> (ms)
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -254,7 +259,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#hold', 55, 65);">Hold Token Timeout</a> (ms)
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#hold', 55, 65)">Hold Token Timeout</a> (ms)
</td>
<td class="systemsTable">
<input type="text" size="10" name="hold"
@@ -264,7 +269,7 @@
<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)
+ <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">
<input type="text" size="10" name="send_join"
@@ -274,7 +279,7 @@
<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)
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#merge', 55, 65)">Merge Detection Timeout</a> (ms)
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -285,7 +290,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#downcheck', 55, 65);">Interface Down Check Timeout</a> (ms)
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#downcheck', 55, 65)">Interface Down Check Timeout</a> (ms)
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -296,7 +301,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#fail_to_recv_const', 55, 65);">Fail to Receive Constant</a>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#fail_to_recv_const', 55, 65)">Fail to Receive Constant</a>
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -307,7 +312,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#seqno_unchanged_const', 55, 65);">Rotations with no mcast traffic before merge detection timeout started</a>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#seqno_unchanged_const', 55, 65)">Rotations with no mcast traffic before merge detection timeout started</a>
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -318,7 +323,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#heartbeat_failures_allowed', 55, 65);">Number of Heartbeat Failures Allowed</a>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#heartbeat_failures_allowed', 55, 65)">Number of Heartbeat Failures Allowed</a>
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -329,7 +334,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#max_network_delay', 55, 65);">Maximum Network Delay</a> (ms)
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#max_network_delay', 55, 65)">Maximum Network Delay</a> (ms)
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -340,7 +345,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#window_size', 55, 65);">Window Size</a>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#window_size', 55, 65)">Window Size</a>
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -351,7 +356,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#max_messages', 55, 65);">Maximum Messages</a>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#max_messages', 55, 65)">Maximum Messages</a>
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -362,7 +367,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#rrp_problem_count_timeout', 55, 65);">RRP Problem Count Timeout</a> (ms)
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#rrp_problem_count_timeout', 55, 65)">RRP Problem Count Timeout</a> (ms)
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -373,7 +378,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#rrp_problem_count_threshold', 55, 65);">RRP Problem Count Threshold</a>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#rrp_problem_count_threshold', 55, 65)">RRP Problem Count Threshold</a>
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -384,7 +389,7 @@
<tr class="systemsTable">
<td class="systemsTable">
- <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#rrp_token_expired_timeout', 55, 65);">RRP Token Expired Timeout</a>
+ <a class="cluster_help" href="javascript:popup_window('/luci/doc/config_rhel5#rrp_token_expired_timeout', 55, 65)">RRP Token Expired Timeout</a>
</td>
<td class="systemsTable">
<input type="text" size="10"
@@ -402,7 +407,7 @@
<td class="systemsTable" colspan="2">
<div class="systemsTableEnd">
<input type="button" value="Apply"
- onClick="validate_form(this.form);"/>
+ onclick="validate_config_form(this.form)"/>
</div>
</td>
</tr>
@@ -410,7 +415,13 @@
</form>
</div>
- <div id="configTabContent" tal:condition="python: configTabNum == 2">
+ <div id="configtab2"
+ tal:attributes="class python:'configTabMainContent ' + (configTabNum == 2 and ' ' or 'invisible')">
+
+ <script type="text/javascript"
+ src="/luci/cluster/validate_config_fence.js">
+ </script>
+
<form name="fencedaemon" method="post" id="fence_config_form" action="">
<input type="hidden" name="configtype" value="fence" />
<input type="hidden" name="pagetype"
@@ -421,13 +432,6 @@
<input type="hidden" name="clustername"
tal:attributes="value request/clustername | clusterinfo/clustername | nothing" />
- <script type="text/javascript"
- src="/luci/homebase/homebase_common.js">
- </script>
- <script type="text/javascript"
- src="/luci/cluster/validate_config_fence.js">
- </script>
-
<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
<thead class="systemsTable">
<tr class="systemsTable"><td class="systemsTable" colspan="1">
@@ -531,7 +535,7 @@
<div class="systemsTableEnd">
<input type="button" value="Apply"
id="fence_config_submit"
- onClick="validate_form(this.form)" />
+ onclick="validate_fence_form(this.form)" />
</div>
</td>
</tr>
@@ -540,10 +544,8 @@
</form>
</div>
- <div id="configTabContent" tal:condition="python: configTabNum == 3">
- <script type="text/javascript"
- src="/luci/homebase/homebase_common.js">
- </script>
+ <div id="configtab3"
+ tal:attributes="class python:'configTabMainContent ' + (configTabNum == 3 and ' ' or 'invisible')">
<script type="text/javascript"
src="/luci/cluster/validate_config_multicast.js">
</script>
@@ -570,7 +572,7 @@
<tr class="systemsTable">
<td class="systemsTable">
<input type="radio" name="mcast" value="False"
- onClick="disable_mcast('mcast_address', 'mcast_interface');"
+ onclick="disable_mcast('mcast_address', 'mcast_interface')"
tal:attributes="checked python: clusterinfo['is_mcast'] != 'True'"
/>
<tal:block tal:condition="python:os_version == 'rhel4'">
@@ -585,7 +587,7 @@
<tr class="systemsTable">
<td class="systemsTable">
<input type="radio" name="mcast" value="True"
- onClick="enable_mcast('mcast_address', 'mcast_interface');"
+ onclick="enable_mcast('mcast_address', 'mcast_interface')"
tal:attributes="checked python: clusterinfo['is_mcast'] == 'True'"
/>
@@ -628,7 +630,7 @@
<tr class="systemsTable"><td class="systemsTable" colspan="2">
<div class="systemsTableEnd">
<input type="button" value="Apply"
- onClick="validate_form(this.form);"/>
+ onclick="validate_mcast_form(this.form)"/>
</div>
</td></tr>
</tfoot>
@@ -636,13 +638,12 @@
</form>
</div>
- <div id="configTabContent" tal:condition="python: configTabNum == 4">
- <script type="text/javascript"
- src="/luci/homebase/homebase_common.js">
- </script>
- <script type="text/javascript"
- src="/luci/cluster/validate_config_qdisk.js">
- </script>
+ <div id="configtab4"
+ tal:attributes="class python:'configTabMainContent ' + (configTabNum == 4 and ' ' or 'invisible')">
+ <script type="text/javascript"
+ src="/luci/cluster/validate_config_qdisk.js">
+ </script>
+
<form name="quorum_partition" action="" method="post">
<input type="hidden" name="pagetype"
tal:attributes="value request/pagetype | request/form/pagetype"
@@ -665,14 +666,14 @@
<tbody class="systemsTable" id="sys_tbody">
<tr class="systemsTable" id="st_row"><td class="systemsTable" id="st_col">
<input type="radio" name="quorumd" value="False"
- onClick="disableChildrenInput('quorumdisk');"
+ onclick="disableChildrenInput('quorumdisk')"
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');"
+ onclick="enableChildrenInput('quorumdisk')"
tal:attributes="checked python: (clusterinfo['is_quorumd']) and 'checked' or ''" />
Use a Quorum Partition
</td></tr>
@@ -783,7 +784,7 @@
id="heuristic0:hdel" name="heuristic0:hdel"
src="delete-row.png"
title="delete this heuristic"
- onClick="delete_qdisk_heur(this, document.quorum_partition);">
+ onclick="delete_qdisk_heur(this, document.quorum_partition)">
</td>
</tr>
</tal:block>
@@ -827,7 +828,7 @@
<img class="qdisk deleteRow"
src="delete-row.png"
title="delete this heuristic"
- onClick="delete_qdisk_heur(this, document.quorum_partition);"
+ onclick="delete_qdisk_heur(this, document.quorum_partition)"
tal:attributes="
id python: 'heuristic' + str(curHeur) + ':hdel';
name python: 'heuristic' + str(curHeur) + ':hdel'" />
@@ -838,7 +839,7 @@
<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>
@@ -848,7 +849,7 @@
<div class="spacing configTabContent"></div>
<div class="hbSubmit spacing configTabContent">
<input type="button" value="Apply"
- onClick="validate_form(this.form)" />
+ onclick="validate_qdisk_form(this.form)" />
</div>
<script tal:condition="not: clusterinfo/is_quorumd">
disableChildrenInput('quorumdisk');
@@ -857,10 +858,8 @@
</div>
<tal:block tal:condition="clusterinfo/gulm">
- <div id="configTabContent" tal:condition="python: configTabNum == 5">
- <script type="text/javascript"
- src="/luci/homebase/homebase_common.js">
- </script>
+ <div id="configtab5"
+ tal:attributes="class python:'configTabMainContent ' + (configTabNum == 5 and ' ' or 'invisible')">
<script type="text/javascript"
src="/luci/cluster/validate_config_gulm.js">
</script>
@@ -944,7 +943,7 @@
<div class="spacing configTabContent"></div>
<div class="hbSubmit spacing configTabContent">
<input type="button" value="Apply"
- onClick="validate_form(this.form)"/>
+ onclick="validate_gulm_form(this.form)"/>
</div>
</div>
</tal:block>
--- conga/luci/cluster/validate_config_fence.js 2007/08/08 21:00:06 1.4
+++ conga/luci/cluster/validate_config_fence.js 2008/01/02 17:36:52 1.5
@@ -7,7 +7,7 @@
** Free Software Foundation.
*/
-function validate_form(form) {
+function validate_fence_form(form) {
var errors = new Array();
if (!form)
--- conga/luci/cluster/validate_config_general.js 2007/08/08 21:00:06 1.5
+++ conga/luci/cluster/validate_config_general.js 2008/01/02 17:36:52 1.6
@@ -7,7 +7,7 @@
** Free Software Foundation.
*/
-function validate_form(form) {
+function validate_config_form(form) {
var errors = new Array();
var name = null;
var ver = null;
--- conga/luci/cluster/validate_config_gulm.js 2007/08/08 21:00:06 1.4
+++ conga/luci/cluster/validate_config_gulm.js 2008/01/02 17:36:52 1.5
@@ -7,7 +7,7 @@
** Free Software Foundation.
*/
-function validate_form(form) {
+function validate_gulm_form(form) {
var errors = new Array();
var lscount = 0;
--- conga/luci/cluster/validate_config_multicast.js 2007/09/11 16:04:32 1.7
+++ conga/luci/cluster/validate_config_multicast.js 2008/01/02 17:36:52 1.8
@@ -40,7 +40,7 @@
}
}
-function validate_form(form) {
+function validate_mcast_form(form) {
var errors = new Array();
if (!form.mcast) {
--- conga/luci/cluster/validate_config_qdisk.js 2007/09/25 03:51:02 1.10
+++ conga/luci/cluster/validate_config_qdisk.js 2008/01/02 17:36:52 1.11
@@ -141,7 +141,7 @@
return (null);
}
-function validate_form(form) {
+function validate_qdisk_form(form) {
var errors = new Array();
if (!form || !form.quorumd) {
--- conga/luci/plone-custom/conga.js 2007/12/12 15:50:18 1.9
+++ conga/luci/plone-custom/conga.js 2008/01/02 17:36:52 1.10
@@ -206,7 +206,7 @@
cur_tab_elem.className += ' invisible';
new_tab_elem.className = new_tab_elem.className.replace(/invisible/gi, '');
- new_label.className += 'configTab configTabActive';
+ new_label.className = 'configTab configTabActive';
var cur_label = document.getElementById(cur_tab + '_label');
cur_label.className = 'configTab';
} catch (e) {
--- conga/luci/plone-custom/luci.css 2007/12/12 15:50:18 1.2
+++ conga/luci/plone-custom/luci.css 2008/01/02 17:36:52 1.3
@@ -75,15 +75,6 @@
width: 50%;
}
-ul.configTab {
- color: #436976 !important;
- margin: 20px 0px 0px 0px !important;
- padding: 0px !important;
- padding-left: 15px !important;
- border-bottom: none !important;
- z-index: 1 !important;
-}
-
input.qdisk {
font-family: "Bitstream Vera Sans Mono", "DejaVu Sans Mono", monospace ! important;
font-size: 12px ! important;
@@ -128,43 +119,53 @@
margin-bottom: +.5em;
}
-li.configTab {
- display: inline ! important;
- overflow: hidden ! important;
+div.configTab {
+ margin-top: 2em;
+}
+
+ul.configTab {
+ text-align: left ! important;
+ margin: 1em 0 1em 0 ! important;
list-style-type: none ! important;
- padding-left: 6px ! important;
- padding-bottom: 0px ! important;
- margin-bottom: 0px ! important;
- border-bottom: none ! important;
+ line-height: normal ! important;
+ padding: 3px 10px 0px 10px ! important;
+ display: inline ! important;
}
-div.configTabMainContent {
- background: #dee7ec !important;
- margin-top: 0px !important;
- padding: 20px !important;
- border: 1px solid #8cacbb !important;
- z-index: 2 !important;
- max-width: 700px;
+li.configTab {
+ display: inline ! important;
+ background-color: #ffffff ! important;
+ margin-bottom: 0px ! important;
+ padding-right: .3333em;
}
-a.configTab, a.configTabActive {
- color: #436976 !important;
- background: #ffffff !important;
- border: 1px solid #8cacbb !important;
- border-bottom: 1px solid transparent !important;
- padding: 2px 6px 0px 6px !important;
- margin: 0 !important;
- text-decoration: none !important;
+a.configTab {
+ padding: 0px 4px 0px ! important;
+ border: 1px solid #8cacbb ! important;
+ border-bottom: 1px solid #8cacbb ! important;
+ background-color: #ffffff ! important;
+ margin-right: 0px ! important;
+ text-decoration: none ! important;
+ cursor: pointer;
}
a.configTabActive {
- background: #dee7ec !important;
- border-bottom: 2px solid #dee7ec !important;
+ color: #436976 ! important;
+ background-color: #dee7ec ! important;
+ border-bottom: 1px solid #dee7ec ! important;
}
a.configTab:hover {
- color: #436976 !important;
- background: #dee7ec !important;
+ color: #436976 ! important;
+ background-color: #dee7ec ! important;
+}
+
+div.configTabMainContent {
+ background-color: #dee7ec ! important;
+ margin-top: 0px ! important;
+ padding: 20px ! important;
+ border: 1px solid #8cacbb ! important;
+ max-width: 700px;
}
*.errmsgs,*.retmsgs {
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] conga/luci cluster/cluster_config-macros clust ...
@ 2008-02-08 21:48 rmccabe
0 siblings, 0 replies; 3+ messages in thread
From: rmccabe @ 2008-02-08 21:48 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2008-02-08 21:48:12
Modified files:
luci/cluster : cluster_config-macros cluster_svc-macros
form-chooser form-macros index_html
system_svc-macros
luci/homebase : form-macros index_html
luci/site/luci/Extensions: LuciValidation.py LuciZope.py
LuciZopeAsync.py LuciZopeExternal.py
conga_constants.py
luci/site/luci/var: Data.fs
luci/storage : index_html
Added files:
luci/plone-custom: manage_inactive.js
Log message:
Fixes for 429151 and 429152
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_config-macros.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_svc-macros.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.221&r2=1.222
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/index_html.diff?cvsroot=cluster&r1=1.41&r2=1.42
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/system_svc-macros.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.66&r2=1.67
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/index_html.diff?cvsroot=cluster&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/manage_inactive.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZope.py.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeAsync.py.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciZopeExternal.py.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.48&r2=1.49
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/Data.fs.diff?cvsroot=cluster&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/index_html.diff?cvsroot=cluster&r1=1.14&r2=1.15
--- conga/luci/cluster/cluster_config-macros 2008/01/02 20:52:22 1.3
+++ conga/luci/cluster/cluster_config-macros 2008/02/08 21:47:55 1.4
@@ -22,9 +22,6 @@
var cur_label_elem = null;
</script>
<script type="text/javascript"
- src="conga_ajax.js">
- </script>
- <script type="text/javascript"
src="validate_xvm_key.js">
</script>
--- conga/luci/cluster/cluster_svc-macros 2008/01/15 04:41:41 1.3
+++ conga/luci/cluster/cluster_svc-macros 2008/02/08 21:47:55 1.4
@@ -623,7 +623,6 @@
<script type="text/javascript"
src="/luci/homebase/homebase_common.js">
</script>
- <script type="text/javascript" src="conga_ajax.js"></script>
<script type="text/javascript"
src="/luci/cluster/resource_form_handlers.js">
</script>
--- conga/luci/cluster/form-chooser 2008/01/22 15:02:33 1.24
+++ conga/luci/cluster/form-chooser 2008/02/08 21:47:55 1.25
@@ -229,6 +229,14 @@
<tal:block tal:condition="python: ptype == '1002'">
<div metal:use-macro="here/form-macros/macros/get-system-info-form" />
</tal:block>
+
+ <tal:block tal:condition="python: ptype == '1010'">
+ <div metal:use-macro="here/form-macros/macros/check-inactive-form" />
+ </tal:block>
+
+ <tal:block tal:condition="python: ptype == '1011'">
+ <div metal:use-macro="here/form-macros/macros/update-inactive-form" />
+ </tal:block>
</tal:block>
</metal:choose-form>
--- conga/luci/cluster/form-macros 2008/01/25 00:36:59 1.221
+++ conga/luci/cluster/form-macros 2008/02/08 21:47:55 1.222
@@ -156,7 +156,6 @@
<script type="text/javascript" src="/luci/homebase/homebase_common.js"></script>
<script type="text/javascript" src="/luci/homebase/validate_cluster_add.js"></script>
<script type="text/javascript" src="validate_create_gulm.js"></script>
- <script type="text/javascript" src="conga_ajax.js"></script>
<script type="text/javascript" src="update_hostinfo.js"></script>
<script type="text/javascript">
@@ -1075,7 +1074,6 @@
</script>
<script type="text/javascript" src="/luci/homebase/validate_cluster_add.js">
</script>
- <script type="text/javascript" src="conga_ajax.js"></script>
<script type="text/javascript" src="update_hostinfo.js"></script>
<form name="add_node" action="" method="post"
@@ -1324,5 +1322,14 @@
<tal:block tal:define="ret python: here.get_sysinfo_async(request)" />
</div>
+<div metal:define-macro="check-inactive-form">
+ <tal:block tal:define="ret python: here.check_inactive_async(request)" />
+</div>
+
+<div metal:define-macro="update-inactive-form">
+ <tal:block tal:define="ret python: here.update_inactive_async(request)" />
+</div>
+
+
</body>
</html>
--- conga/luci/cluster/index_html 2008/01/22 15:02:33 1.41
+++ conga/luci/cluster/index_html 2008/02/08 21:47:56 1.42
@@ -58,17 +58,10 @@
</metal:headslot>
<metal:cssslot fill-slot="css_slot">
- <style type="text/css">
- <!-- @import url(clusterportlet.css); -->
- </style>
- <style type="text/css">
- <!-- @import url(luci.css); -->
- </style>
<metal:cssslot define-slot="css_slot" />
</metal:cssslot>
<metal:javascriptslot fill-slot="javascript_head_slot">
- <script type="text/javascript" src="/luci/conga.js"></script>
<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
--- conga/luci/cluster/system_svc-macros 2008/01/02 20:52:22 1.2
+++ conga/luci/cluster/system_svc-macros 2008/02/08 21:47:56 1.3
@@ -17,9 +17,6 @@
<div metal:define-macro="system-svc-form">
<script type="text/javascript"
- src="conga_ajax.js">
- </script>
- <script type="text/javascript"
src="/luci/cluster/validate_sys_svc.js">
</script>
<h2>Configure System Services</h2>
--- conga/luci/homebase/form-macros 2008/02/06 04:57:50 1.66
+++ conga/luci/homebase/form-macros 2008/02/08 21:47:56 1.67
@@ -289,7 +289,6 @@
-> if yes, confirm again, showing list
</tal:comment>
- <script type="text/javascript" src="conga_ajax.js"></script>
<script type="text/javascript" src="update_hostinfo.js"></script>
<script type="text/javascript" src="validate_auth.js"></script>
<script type="text/javascript" src="/luci/homebase/validate_sys_remove.js">
@@ -612,7 +611,6 @@
<script type="text/javascript" src="/luci/homebase/validate_sys_add.js">
</script>
- <script type="text/javascript" src="conga_ajax.js"></script>
<script type="text/javascript" src="update_hostinfo.js"></script>
<script type="text/javascript">
@@ -940,7 +938,6 @@
- At least one node name/password are given and are valid
</tal:comment>
- <script type="text/javascript" src="conga_ajax.js"></script>
<script type="text/javascript" src="update_hostinfo.js"></script>
<script type="text/javascript" src="/luci/homebase/validate_cluster_add_initial.js">
</script>
--- conga/luci/homebase/index_html 2008/01/22 15:02:32 1.26
+++ conga/luci/homebase/index_html 2008/02/08 21:47:56 1.27
@@ -34,20 +34,12 @@
</metal:headslot>
<metal:cssslot fill-slot="css_slot">
- <style type="text/css">
- <!-- @import url(clusterportlet.css); -->
- </style>
-
- <style type="text/css">
- <!-- @import url(luci.css); -->
- </style>
<tal:block
tal:define="global data python:here.homebaseControl(request)" />
<metal:cssslot define-slot="css_slot" />
</metal:cssslot>
<metal:javascriptslot fill-slot="javascript_head_slot">
- <script type="text/javascript" src="/luci/conga.js"></script>
<script type="text/javascript"
src="/luci/homebase/homebase_common.js">
</script>
/cvs/cluster/conga/luci/plone-custom/manage_inactive.js,v --> standard output
revision 1.1
--- conga/luci/plone-custom/manage_inactive.js
+++ - 2008-02-08 21:48:13.610802000 +0000
@@ -0,0 +1,84 @@
+/*
+** Copyright (C) 2008 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+*/
+
+var update_activity_url = '/luci/cluster?pagetype=1011';
+var check_inactive_url = '/luci/cluster?pagetype=1010';
+var pending_events = 0;
+
+function activity_event_handler() {
+ ++pending_events;
+}
+
+function update_activity_check(ret_status, obj) {
+ /* Doesn't matter what comes back */
+ return;
+}
+
+function check_inactive_check(ret_status, obj) {
+ if (ret_status === null) {
+ return;
+ }
+
+ if (ret_status !== true) {
+ /* A communication error occurred. */
+ return;
+ }
+
+ var err = get_ricci_response_status(obj.responseXML);
+ if (err !== null && err.length > 0) {
+ alert(err.join('\n'));
+ return;
+ }
+
+ try {
+ obj = obj.responseXML.getElementsByTagName('dict')[0];
+ } catch (e) {
+ alert('Received a malformed response from the luci server.');
+ return;
+ }
+
+ var var_elem = obj.getElementsByTagName('var');
+ for (var i = 0 ; i < var_elem.length ; i++) {
+ if (var_elem[i].getAttribute('name') == 'inactive') {
+ if (var_elem[i].getAttribute('value') != 'False') {
+ window.location.assign('/luci/logout');
+ alert('You have been logged out due to inactivity.');
+ }
+ }
+ }
+}
+
+function update_activity_callback() {
+ return check_ajax_xml(xmlHttp_object, update_activity_check);
+}
+
+function check_inactive_callback() {
+ return check_ajax_xml(xmlHttp_object, check_inactive_check);
+}
+
+function update_last_active() {
+ if (pending_events < 1) {
+ return (false);
+ }
+ initiate_async_get(update_activity_url, update_activity_callback);
+ pending_events = 0;
+ return (true);
+}
+
+function check_user_inactive() {
+ if (update_last_active() === true) {
+ return (0);
+ }
+ return (initiate_async_get(check_inactive_url, check_inactive_callback));
+}
+
+setInterval("update_last_active()", 1000 * 30);
+setInterval("check_user_inactive()", 1000 * 60);
+window.onmousemove = new Function('activity_event_handler()');
+window.onkeypress = new Function('activity_event_handler()');
--- conga/luci/site/luci/Extensions/LuciValidation.py 2008/02/05 18:26:54 1.7
+++ conga/luci/site/luci/Extensions/LuciValidation.py 2008/02/08 21:47:56 1.8
@@ -8,7 +8,6 @@
from ClusterModel.RefObject import RefObject
from ClusterModel.Service import Service
from ClusterModel.Method import Method
-from ClusterModel.Fence import Fence
from ClusterModel.FailoverDomain import FailoverDomain
from ClusterModel.FailoverDomainNode import FailoverDomainNode
from ClusterModel.QuorumD import QuorumD
--- conga/luci/site/luci/Extensions/LuciZope.py 2008/02/06 05:19:57 1.8
+++ conga/luci/site/luci/Extensions/LuciZope.py 2008/02/08 21:47:56 1.9
@@ -82,6 +82,8 @@
if not userAuthenticated(self):
return []
+ enforce_inactivity_timeout(self, req)
+
htab = {
'Title': 'homebase',
'Description': 'Home base for this luci server',
@@ -163,28 +165,42 @@
return '/luci/cluster/index_html?pagetype=7&clustername=%s' % clustername
+def user_update_inactive(self, request):
+ from time import time
+ if userAuthenticated(self):
+ request.SESSION.set('last_activity', int(time()))
+
def user_check_inactive(self, request):
from time import time
from conga_constants import INACTIVITY_TIMEOUT_SEC as INACTIVITY_TIMEOUT
if not userAuthenticated(self):
- return
+ return (False, -1)
cur_time = int(time())
old_time = request.SESSION.get('last_activity', None)
if old_time is None:
request.SESSION.set('last_activity', cur_time)
- return
+ return (False, -2)
old_time = int(old_time)
time_diff = cur_time - old_time
if time_diff >= INACTIVITY_TIMEOUT:
- try:
- request.SESSION.getBrowserIdManager().flushBrowserIdCookie()
- request.SESSION.invalidate()
- except Exception, e:
- if LUCI_DEBUG_MODE is True:
- luci_log.debug_verbose('UCI0: %r %s' % (e, str(e)))
- request.RESPONSE.redirect('/luci/logout')
- else:
- request.SESSION.set('last_activity', cur_time)
+ return (True, time_diff)
+ return (False, time_diff)
+
+def enforce_inactivity_timeout(self, request):
+ from time import time
+ pagetype = request.get('pagetype')
+ if pagetype != '1010' and pagetype != '1011':
+ (ret, dummy) = user_check_inactive(self, request)
+ if ret is True:
+ try:
+ request.SESSION.getBrowserIdManager().flushBrowserIdCookie()
+ request.SESSION.invalidate()
+ except Exception, e:
+ if LUCI_DEBUG_MODE is True:
+ luci_log.debug_verbose('UCI0: %r %s' % (e, str(e)))
+ request.RESPONSE.redirect('/luci/logout')
+ else:
+ request.SESSION.set('last_activity', int(time()))
--- conga/luci/site/luci/Extensions/LuciZopeAsync.py 2008/02/07 06:13:04 1.7
+++ conga/luci/site/luci/Extensions/LuciZopeAsync.py 2008/02/08 21:47:56 1.8
@@ -169,6 +169,18 @@
xml_obj = result_to_xml((len(errors) < len(node_list), ret))
write_xml_resp(request, xml_obj)
+def check_inactive_async(self, request):
+ from LuciZope import user_check_inactive
+ (inactive, diff) = user_check_inactive(self, request)
+ xml_obj = result_to_xml((True, { 'inactive': inactive, 'diff': diff }))
+ write_xml_resp(request, xml_obj)
+
+def update_inactive_async(self, request):
+ from LuciZope import user_update_inactive
+ user_update_inactive(self, request)
+ xml_obj = result_to_xml((True, { 'result': True }))
+ write_xml_resp(request, xml_obj)
+
def get_sysinfo_async(self, request):
from HelperFunctions import get_system_info
--- conga/luci/site/luci/Extensions/LuciZopeExternal.py 2008/02/06 05:19:57 1.8
+++ conga/luci/site/luci/Extensions/LuciZopeExternal.py 2008/02/08 21:47:56 1.9
@@ -35,7 +35,7 @@
from LuciZope import appendModel, bytes_to_value_prefunits, \
set_persistent_var, strFilter, getTabs, siteIsSetup, \
- getClusterURL, user_check_inactive
+ getClusterURL
from LuciZopeClusterPortal import createCluChooser, createCluConfigTree
@@ -55,4 +55,4 @@
from system_adapters import get_sys_svc_list, validate_manage_svc
from LuciZopeAsync import get_cluster_nodes_async, get_sysinfo_async, \
- validate_clusvc_async
+ validate_clusvc_async, check_inactive_async, update_inactive_async
--- conga/luci/site/luci/Extensions/conga_constants.py 2008/02/06 05:19:57 1.48
+++ conga/luci/site/luci/Extensions/conga_constants.py 2008/02/08 21:47:56 1.49
@@ -136,7 +136,6 @@
]
REDIRECT_SEC = 5
-INACTIVITY_TIMEOUT_SEC = 600
# cluster/node create error status messages
PRE_INSTALL = 'The install state is not yet complete.'
@@ -148,6 +147,9 @@
REDIRECT_MSG = ' -- You will be redirected in %d seconds.' % REDIRECT_SEC
+# Log users out after 10 minutes of inactivity.
+
+INACTIVITY_TIMEOUT_SEC = 600
# Debugging parameters. Set LUCI_DEBUG_MODE to True and LUCI_DEBUG_VERBOSITY
# to >= 2 to get full debugging output in syslog (LOG_DAEMON/LOG_DEBUG).
Binary files /cvs/cluster/conga/luci/site/luci/var/Data.fs 2008/02/06 21:23:52 1.30 and /cvs/cluster/conga/luci/site/luci/var/Data.fs 2008/02/08 21:47:56 1.31 differ
rcsdiff: /cvs/cluster/conga/luci/site/luci/var/Data.fs: diff failed
--- conga/luci/storage/index_html 2007/09/26 21:36:56 1.14
+++ conga/luci/storage/index_html 2008/02/08 21:48:12 1.15
@@ -36,7 +36,6 @@
<metal:javascriptslot fill-slot="javascript_head_slot">
<metal:javascriptslot define-slot="javascript_head_slot">
<!-- async helper functions -->
- <script type="text/javascript" src="conga.js"></script>
<script type="text/javascript" src="storage_async.js"></script>
</metal:javascriptslot>
</metal:javascriptslot>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] conga/luci cluster/cluster_config-macros clust ...
@ 2009-02-17 20:49 rmccabe
0 siblings, 0 replies; 3+ messages in thread
From: rmccabe @ 2009-02-17 20:49 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2009-02-17 20:49:29
Modified files:
luci/cluster : cluster_config-macros fence-macros
validate_fence.js
luci/plone-custom: conga_ajax.js validate_auth.js
luci/site/luci/Extensions: FenceHandler.py LuciClusterInfo.py
LuciValidation.py ResourceHandler.py
luci/site/luci/Extensions/ClusterModel: FenceDaemon.py
FenceDeviceAttr.py
ModelBuilder.py
QuorumD.py
luci/site/luci/var: Data.fs
Log message:
Backport fixes from RHEL5
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_config-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.4.2.2&r2=1.4.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.4.6&r2=1.2.4.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_fence.js.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.8&r2=1.3.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/conga_ajax.js.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.2&r2=1.3.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/validate_auth.js.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.4.2&r2=1.1.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.17.2.10&r2=1.17.2.11
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.10.2.7&r2=1.10.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciValidation.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.9.2.3&r2=1.9.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ResourceHandler.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.2.6&r2=1.2.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FenceDaemon.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.2.2&r2=1.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.4.1&r2=1.5.4.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.6&r2=1.5.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/QuorumD.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.2.2&r2=1.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/Data.fs.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.20.2.27&r2=1.20.2.28
--- conga/luci/cluster/cluster_config-macros 2008/11/10 21:02:43 1.4.2.2
+++ conga/luci/cluster/cluster_config-macros 2009/02/17 20:48:57 1.4.2.3
@@ -454,6 +454,18 @@
tal:attributes="value clusterinfo/pjd" />
</td>
</tr>
+
+ <tr tal:condition="clusterinfo/has_ignore_undef_fence"
+ class="systemsTable">
+
+ <td class="systemsTable">Skip nodes with undefined fencing</td>
+ <td class="systemsTable">
+ <input type="checkbox" name="skip_undefined"
+ tal:attributes="checked python: clusterinfo.get('skip_undefined') and 'checked' or ''" />
+ </td>
+ </tr>
+
+
<tr class="systemsTable">
<td class="systemsTable">
<span class="cluster_help" title="Enable if you will be running a VM cluster on this physical cluster">Run XVM fence daemon</td>
--- conga/luci/cluster/fence-macros 2008/11/10 21:02:43 1.2.4.6
+++ conga/luci/cluster/fence-macros 2009/02/17 20:48:57 1.2.4.7
@@ -218,6 +218,14 @@
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-egenera" />
</tal:block>
+ <tal:block tal:condition="python: cur_fence_type == 'fence_lpar'">
+ <tal:block metal:use-macro="here/fence-macros/macros/fence-form-lpar" />
+ </tal:block>
+
+ <tal:block tal:condition="python: cur_fence_type == 'fence_vmware'">
+ <tal:block metal:use-macro="here/fence-macros/macros/fence-form-vmware" />
+ </tal:block>
+
<tal:block tal:condition="python: cur_fence_type == 'fence_bladecenter'">
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-bladecenter" />
</tal:block>
@@ -325,6 +333,8 @@
<option name="fence_bullpap" value="fence_bullpap">Bull PAP</option>
<option name="fence_xvm" value="fence_xvm">Virtual Machine Fencing</option>
<option name="fence_scsi" value="fence_scsi">SCSI Fencing</option>
+ <option name="fence_vmware" value="fence_vmware">VMWare Fencing</option>
+ <option name="fence_lpar" value="fence_lpar">LPAR Fencing</option>
</div>
<div metal:define-macro="fence-option-list">
@@ -347,6 +357,8 @@
<option name="fence_ipmilan" value="fence_ipmilan">IPMI Lan</option>
<option name="fence_xvm" value="fence_xvm">Virtual Machine Fencing</option>
<option name="fence_scsi" value="fence_scsi">SCSI Fencing</option>
+ <option name="fence_vmware" value="fence_vmware">VMWare Fencing</option>
+ <option name="fence_lpar" value="fence_lpar">LPAR Fencing</option>
<option name="fence_manual" value="fence_manual">Manual Fencing</option>
</div>
@@ -1084,6 +1096,175 @@
</div>
</div>
+<div metal:define-macro="fence-form-lpar"
+ tal:attributes="id cur_fencedev/name | nothing">
+
+ <div id="fence_lpar" class="fencedev">
+ <table>
+ <tr>
+ <td><strong class="cluster">Fence Type</strong></td>
+ <td>LPAR</td>
+ </tr>
+ <tr>
+ <td>Name</td>
+ <td>
+ <input name="name" type="text"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/name | nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>Hostname</td>
+ <td>
+ <input name="ipaddr" type="text"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/ipaddr | nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>Login</td>
+ <td>
+ <input name="login" type="text"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/login | nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>Password</td>
+ <td>
+ <input name="passwd" type="password" autocomplete="off"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span title="Full path to a script to generate fence password">Password Script (optional)</span>
+ </td>
+ <td>
+ <input type="text" name="passwd_script"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/passwd_script | nothing" />
+ </td>
+ </tr>
+ </table>
+
+ <tal:block tal:condition="exists: cur_fencedev">
+ <input type="hidden" name="existing_device" value="1" />
+ <input type="hidden" name="orig_name"
+ tal:attributes="value cur_fencedev/name | nothing" />
+ </tal:block>
+
+ <input type="hidden" name="sharable" value="1" />
+ <input type="hidden" name="fence_type" value="fence_lpar" />
+ </div>
+</div>
+
+<div metal:define-macro="fence-form-vmware"
+ tal:attributes="id cur_fencedev/name | nothing">
+
+ <div id="fence_vmware" class="fencedev">
+ <table>
+ <tr>
+ <td><strong class="cluster">Fence Type</strong></td>
+ <td>VMWare</td>
+ </tr>
+ <tr>
+ <td>Name</td>
+ <td>
+ <input name="name" type="text"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/name | nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>Hostname</td>
+ <td>
+ <input name="ipaddr" type="text"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/ipaddr | nothing" />
+ </td>
+ </tr>
+
+ <tr>
+ <td>Login</td>
+ <td>
+ <input name="login" type="text"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/login | nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>Password</td>
+ <td>
+ <input name="passwd" type="password" autocomplete="off"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span title="Full path to a script to generate fence password">Password Script (optional)</span>
+ </td>
+ <td>
+ <input type="text" name="passwd_script"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/passwd_script | nothing" />
+ </td>
+ </tr>
+
+ <tr>
+ <td>VMware ESX Management Login</td>
+ <td>
+ <input name="vmlogin" type="text"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/vmlogin | nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>VMware ESX Management Password</td>
+ <td>
+ <input name="vmpasswd" type="password" autocomplete="off"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span title="Full path to a script to generate VMware ESX Management password">VMware ESX Management Password Script (optional)</span>
+ </td>
+ <td>
+ <input type="text" name="vmpasswd_script"
+ tal:attributes="
+ disabled cur_fencedev/isShared | nothing;
+ value cur_fencedev/vmpasswd_script | nothing" />
+ </td>
+ </tr>
+ </table>
+
+ <tal:block tal:condition="exists: cur_fencedev">
+ <input type="hidden" name="existing_device" value="1" />
+ <input type="hidden" name="orig_name"
+ tal:attributes="value cur_fencedev/name | nothing" />
+ </tal:block>
+
+ <input type="hidden" name="sharable" value="1" />
+ <input type="hidden" name="fence_type" value="fence_vmware" />
+ </div>
+</div>
+
<div metal:define-macro="fence-form-egenera"
tal:attributes="id cur_fencedev/name | nothing">
@@ -1491,6 +1672,8 @@
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-ipmilan" />
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-xvm" />
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-scsi" />
+ <tal:block metal:use-macro="here/fence-macros/macros/fence-form-lpar" />
+ <tal:block metal:use-macro="here/fence-macros/macros/fence-form-vmware" />
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-manual" />
</div>
@@ -1507,6 +1690,8 @@
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-bullpap" />
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-xvm" />
<tal:block metal:use-macro="here/fence-macros/macros/fence-form-scsi" />
+ <tal:block metal:use-macro="here/fence-macros/macros/fence-form-lpar" />
+ <tal:block metal:use-macro="here/fence-macros/macros/fence-form-vmware" />
</div>
<div metal:define-macro="shared-fence-device-list">
@@ -1609,6 +1794,101 @@
</div>
</div>
+<div metal:define-macro="fence-instance-form-lpar"
+ tal:omit-tag="exists: cur_fence_dev_id">
+ <div id="fence_lpar_instance" name="fence_lpar" class="fencedev_instance"
+ tal:omit-tag="exists: cur_fence_dev_id">
+ <table>
+ <tr>
+ <td>Partition</td>
+ <td>
+ <input name="partition" type="text"
+ tal:attributes="
+ value cur_instance/partition | nothing" />
+ </td>
+ </tr>
+
+ <tr><td colspan="2">
+ <div class="hbSubmit">
+ <tal:block tal:condition="exists:cur_fence_instance_id">
+ <input type="button" name="remove_fence"
+ value="Remove this instance"
+ tal:attributes="onclick python: 'del_fence_instance(\'' + cur_fence_instance_id + '\')'" />
+ </tal:block>
+ <tal:block tal:condition="not:exists:cur_fence_instance_id">
+ <input type="button" name="remove_fence"
+ value="Remove this instance" />
+ </tal:block>
+ </div>
+ </td></tr>
+ </table>
+
+ <input type="hidden" name="option" tal:condition="exists:cur_instance"
+ tal:attributes="value cur_instance/option |nothing" />
+ <input type="hidden" name="fence_type" value="fence_lpar" />
+ <input type="hidden" name="fence_instance" value="1" />
+ <input type="hidden" name="secure" value="1" />
+ <input tal:condition="exists: cur_instance"
+ type="hidden" name="existing_instance" value="1" />
+ <input type="hidden" name="parent_fencedev"
+ tal:attributes="value cur_fence_dev_id | nothing" />
+ </div>
+</div>
+
+<div metal:define-macro="fence-instance-form-vmware"
+ tal:omit-tag="exists: cur_fence_dev_id">
+ <div id="fence_vmware_instance" name="fence_vmware" class="fencedev_instance"
+ tal:omit-tag="exists: cur_fence_dev_id">
+ <table>
+ <tr>
+ <td>Port</td>
+ <td>
+ <input name="port" type="text"
+ tal:attributes="
+ value cur_instance/port | nothing" />
+ </td>
+ </tr>
+
+ <tr tal:condition="exists:clusterinfo/has_fence_ssh">
+ <td>
+ <span title="Enable SSH operation">Use SSH</span>
+ </td>
+ <td>
+ <input tal:condition="exists:cur_instance"
+ type="checkbox" name="secure"
+ tal:attributes="
+ checked python:(cur_instance and cur_instance.has_key('secure') and (cur_instance['secure'] == '1' or cur_instance['secure'].lower() == 'true')) and 'checked' or ''" />
+ <input tal:condition="not:exists:cur_instance"
+ type="checkbox" name="secure" />
+ </td>
+ </tr>
+
+ <tr><td colspan="2">
+ <div class="hbSubmit">
+ <tal:block tal:condition="exists:cur_fence_instance_id">
+ <input type="button" name="remove_fence"
+ value="Remove this instance"
+ tal:attributes="onclick python: 'del_fence_instance(\'' + cur_fence_instance_id + '\')'" />
+ </tal:block>
+ <tal:block tal:condition="not:exists:cur_fence_instance_id">
+ <input type="button" name="remove_fence"
+ value="Remove this instance" />
+ </tal:block>
+ </div>
+ </td></tr>
+ </table>
+
+ <input type="hidden" name="option" tal:condition="exists:cur_instance"
+ tal:attributes="value cur_instance/option |nothing" />
+ <input type="hidden" name="fence_type" value="fence_vmware" />
+ <input type="hidden" name="fence_instance" value="1" />
+ <input tal:condition="exists: cur_instance"
+ type="hidden" name="existing_instance" value="1" />
+ <input type="hidden" name="parent_fencedev"
+ tal:attributes="value cur_fence_dev_id | nothing" />
+ </div>
+</div>
+
<div metal:define-macro="fence-instance-form-egenera"
tal:omit-tag="exists: cur_fence_dev_id">
<div id="fence_egenera_instance" name="fence_egenera" class="fencedev_instance"
@@ -2053,6 +2333,10 @@
<tal:block
metal:use-macro="here/fence-macros/macros/fence-instance-form-egenera" />
<tal:block
+ metal:use-macro="here/fence-macros/macros/fence-instance-form-lpar" />
+ <tal:block
+ metal:use-macro="here/fence-macros/macros/fence-instance-form-vmware" />
+ <tal:block
metal:use-macro="here/fence-macros/macros/fence-instance-form-wti" />
<tal:block
metal:use-macro="here/fence-macros/macros/fence-instance-form-brocade" />
@@ -2117,6 +2401,16 @@
metal:use-macro="here/fence-macros/macros/fence-instance-form-egenera" />
</tal:block>
+ <tal:block tal:condition="python: cur_fence_type == 'fence_lpar'">
+ <tal:block
+ metal:use-macro="here/fence-macros/macros/fence-instance-form-lpar" />
+ </tal:block>
+
+ <tal:block tal:condition="python: cur_fence_type == 'fence_vmware'">
+ <tal:block
+ metal:use-macro="here/fence-macros/macros/fence-instance-form-vmware" />
+ </tal:block>
+
<tal:block tal:condition="python: cur_fence_type == 'fence_bullpap'">
<tal:block
metal:use-macro="here/fence-macros/macros/fence-instance-form-bullpap" />
--- conga/luci/cluster/validate_fence.js 2008/04/23 17:22:59 1.3.2.8
+++ conga/luci/cluster/validate_fence.js 2009/02/17 20:48:57 1.3.2.9
@@ -20,6 +20,8 @@
fence_inst_validator['vixel'] = [ 'port' ];
fence_inst_validator['wti'] = [ 'port', 'secure' ];
fence_inst_validator['xvm'] = [ 'domain' ];
+fence_inst_validator['lpar'] = [ 'partition' ];
+fence_inst_validator['vmware'] = [ 'port' ];
var fence_validator = [];
fence_validator['apc'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
@@ -41,6 +43,8 @@
fence_validator['unknown'] = [];
fence_validator['vixel'] = [ 'ipaddr', 'passwd', 'passwd_script' ];
fence_validator['wti'] = [ 'ipaddr', 'passwd', 'passwd_script' ];
+fence_validator['lpar'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
+fence_validator['vmware'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script', 'vmlogin' ];
fence_validator['xvm'] = [];
function validate_field_str(form, form_elem) {
@@ -120,12 +124,15 @@
field_validator['ipaddr'] = validate_field_host;
field_validator['hostname'] = validate_field_host;
field_validator['login'] = validate_field_str;
+field_validator['vmlogin'] = validate_field_str;
field_validator['passwd'] = validate_field_passwd;
+field_validator['vmpasswd'] = validate_field_noop;
field_validator['servers'] = validate_field_str;
field_validator['cserver'] = validate_field_str;
field_validator['device'] = validate_field_str;
field_validator['port'] = validate_field_str;
field_validator['passwd_script'] = validate_field_noop;
+field_validator['vmpasswd_script'] = validate_field_noop;
/* iLO, DRAC5, WTI, APC, Bladecenter */
field_validator['secure'] = validate_field_noop;
@@ -143,6 +150,7 @@
field_validator['lpan'] = validate_field_str;
field_validator['pserver'] = validate_field_str;
field_validator['domain'] = validate_field_str;
+field_validator['partition'] = validate_field_str;
function validate_fence(form) {
var errors = [];
@@ -179,9 +187,12 @@
for (var i = 0 ; i < fields.length ; i++) {
var field_name = fields[i];
if (form[field_name]) {
- var err = field_validator[field_name](form, form[field_name]);
- if (err) {
- errors = errors.concat(err);
+ try {
+ var err = field_validator[field_name](form, form[field_name]);
+ if (err) {
+ errors = errors.concat(err);
+ }
+ } catch (e) {
}
}
}
--- conga/luci/plone-custom/conga_ajax.js 2008/03/25 01:27:11 1.3.2.2
+++ conga/luci/plone-custom/conga_ajax.js 2009/02/17 20:49:00 1.3.2.3
@@ -12,15 +12,24 @@
function get_xmlhttp_obj() {
xmlHttp_object = false;
- if (!xmlHttp_object && typeof XMLHttpRequest != 'undefined') {
+ if (!xmlHttp_object) {
try {
xmlHttp_object = new XMLHttpRequest();
+ if (!xmlHttp_object) {
+ throw "no XMLHttpRequest";
+ }
} catch (e0) {
try {
xmlHttp_object = new ActiveXObject("Msxml2.XMLHTTP");
+ if (!xmlHttp_object) {
+ throw "no Msxml2.XMLHTTP";
+ }
} catch (e) {
try {
xmlHttp_object = new ActiveXObject("Microsoft.XMLHTTP");
+ if (!xmlHttp_object) {
+ throw "No Microsoft.XMLHTTP";
+ }
} catch (e2) {
xmlHttp_object = false;
}
--- conga/luci/plone-custom/validate_auth.js 2008/12/10 21:02:00 1.1.4.2
+++ conga/luci/plone-custom/validate_auth.js 2009/02/17 20:49:00 1.1.4.3
@@ -94,16 +94,22 @@
var msgs = [];
var systems_list = get_systems_list_offsets(errors);
var os_str = null;
+ var form_elem = null;
for (var i = 0 ; i < systems_list.length ; i++) {
var cur_node_props = node_props[systems_list[i][0]];
var cur_sys_name = systems_list[i][0];
var offset = systems_list[i][1];
+
try {
var addr_elem = document.getElementById('__SYSTEM' + offset + ':Addr');
var pwd_elem = document.getElementById('__SYSTEM' + offset + ':Passwd');
var fp_elem = document.getElementById('__SYSTEM' + offset + 'Fingerprint');
+ if (addr_elem) {
+ form_elem = addr_elem.form;
+ }
+
if (cur_node_props['available'] != 'True') {
set_form_err(addr_elem);
clr_form_err(pwd_elem);
@@ -160,6 +166,13 @@
if (errors.length > 0) {
display_msgs(err_div_id, errors);
+ } else if (form_elem !== null && os_version == 'rhel5') {
+ try {
+ if (form_elem.pagetype.value == '1003') {
+ validate_cluster_create(form_elem);
+ }
+ } catch (e) {
+ }
}
if (msgs.length > 0) {
--- conga/luci/site/luci/Extensions/FenceHandler.py 2008/06/10 14:48:30 1.17.2.10
+++ conga/luci/site/luci/Extensions/FenceHandler.py 2009/02/17 20:49:01 1.17.2.11
@@ -30,6 +30,8 @@
FD_PROVIDE_DEVICE = 'A device must be provided for this Fence Device'
FD_PROVIDE_PORT = 'A port must be provided for this Fence Device'
FD_PROVIDE_IPMILAN_AUTH = 'Authentication type must be "none" (or blank), "md5", or "password"'
+FD_PROVIDE_VMLOGIN = 'A VMware ESX management login name must be provided for this Fence Device'
+FD_PROVIDE_VMPASSWD = 'A VMware ESX management password must be provided for this Fence Device'
FI_PROVIDE_PARENT = 'A Fence Device name must be provided for this Fence'
FI_PROVIDE_SWITCH = 'A switch address must be provided for this Fence'
@@ -40,6 +42,7 @@
FI_PROVIDE_ELPAN = 'A LPAN value must be provided for this Egenera Fence'
FI_PROVIDE_EPSERVER = 'A PServer value must be provided for this Egenera Fence'
FI_PROVIDE_NODENAME = 'A Node Name value must be provided for this SCSI Fence'
+FI_PROVIDE_PARTITION = 'A partition name must be provided for this LPAR Fence'
ILLEGAL_CHARS_REPLACED = 'Illegal characters were replaced by underscores. Feel free to set a new value.'
@@ -534,6 +537,159 @@
return errors
+def val_lpar_fd(form, fencedev):
+ errors = list()
+
+ # fence_lpar currently requires the use of SSH
+ fencedev.addAttribute('secure', '1')
+
+ try:
+ ip = form['ipaddr'].strip()
+ if not ip:
+ raise Exception, 'blank'
+ fencedev.addAttribute('ipaddr', ip)
+ except Exception, e:
+ errors.append(FD_PROVIDE_IP)
+
+ try:
+ log = form['login'].strip()
+ if not log:
+ raise Exception, 'blank'
+ fencedev.addAttribute('login', log)
+ except Exception, e:
+ errors.append(FD_PROVIDE_LOGIN)
+
+ has_passwd = False
+ try:
+ pwd = form['passwd'].strip()
+ if not pwd:
+ # Allow passwords that consist of only spaces.
+ if not form.has_key('passwd') or form['passwd'] == '':
+ raise Exception, 'blank'
+ else:
+ pwd = form['passwd']
+ fencedev.addAttribute('passwd', pwd)
+ has_passwd = True
+ except Exception, e:
+ try:
+ fencedev.removeAttribute('passwd')
+ except:
+ pass
+
+ try:
+ pwd_script = form['passwd_script'].strip()
+ if not pwd_script:
+ raise Exception, 'blank'
+ fencedev.addAttribute('passwd_script', pwd_script)
+ has_passwd = True
+ except Exception, e:
+ try:
+ fencedev.removeAttribute('passwd_script')
+ except:
+ pass
+
+ if not has_passwd:
+ errors.append(FD_PROVIDE_PASSWD)
+ return errors
+
+def val_vmware_fd(form, fencedev):
+ errors = list()
+
+ try:
+ ip = form['ipaddr'].strip()
+ if not ip:
+ raise Exception, 'blank'
+ fencedev.addAttribute('ipaddr', ip)
+ except Exception, e:
+ errors.append(FD_PROVIDE_IP)
+
+ try:
+ log = form['login'].strip()
+ if not log:
+ raise Exception, 'blank'
+ fencedev.addAttribute('login', log)
+ except Exception, e:
+ errors.append(FD_PROVIDE_LOGIN)
+
+ has_passwd = False
+ try:
+ pwd = form['passwd'].strip()
+ if not pwd:
+ # Allow passwords that consist of only spaces.
+ if not form.has_key('passwd') or form['passwd'] == '':
+ raise Exception, 'blank'
+ else:
+ pwd = form['passwd']
+ fencedev.addAttribute('passwd', pwd)
+ has_passwd = True
+ except Exception, e:
+ try:
+ fencedev.removeAttribute('passwd')
+ except:
+ pass
+
+ try:
+ pwd_script = form['passwd_script'].strip()
+ if not pwd_script:
+ raise Exception, 'blank'
+ fencedev.addAttribute('passwd_script', pwd_script)
+ has_passwd = True
+ except Exception, e:
+ try:
+ fencedev.removeAttribute('passwd_script')
+ except:
+ pass
+
+ if not has_passwd:
+ errors.append(FD_PROVIDE_PASSWD)
+ use_ssh = form.has_key('secure') and (form['secure'] == '1' or form['secure'].lower() == 'true')
+ if use_ssh:
+ fencedev.addAttribute('secure', '1')
+ else:
+ fencedev.removeAttribute('secure')
+
+ try:
+ vmlogin = form['vmlogin'].strip()
+ if not vmlogin:
+ raise Exception, 'blank'
+ fencedev.addAttribute('vmlogin', vmlogin)
+ except Exception, e:
+ errors.append(FD_PROVIDE_VMLOGIN)
+
+ has_vmpasswd = False
+ try:
+ vmpwd = form['vmpasswd'].strip()
+ if not vmpwd:
+ # Allow passwords that consist of only spaces.
+ if not form.has_key('vmpasswd') or form['vmpasswd'] == '':
+ raise Exception, 'blank'
+ else:
+ vmpwd = form['vmpasswd']
+ fencedev.addAttribute('vmpasswd', vmpwd)
+ has_vmpasswd = True
+ except Exception, e:
+ try:
+ fencedev.removeAttribute('vmpasswd')
+ except:
+ pass
+
+ try:
+ vmpwd_script = form['vmpasswd_script'].strip()
+ if not vmpwd_script:
+ raise Exception, 'blank'
+ fencedev.addAttribute('vmpasswd_script', vmpwd_script)
+ has_vmpasswd = True
+ except Exception, e:
+ try:
+ fencedev.removeAttribute('vmpasswd_script')
+ except:
+ pass
+
+ if not has_vmpasswd:
+ errors.append(FD_PROVIDE_VMPASSWD)
+
+ return errors
+
def val_noop_fd(dummy, _dummy):
return []
@@ -830,6 +986,8 @@
'fence_mcdata': val_mcdata_fd,
'fence_egenera': val_egenera_fd,
'fence_bullpap': val_bullpap_fd,
+ 'fence_lpar': val_lpar_fd,
+ 'fence_vmware': val_vmware_fd,
'fence_xvm': val_noop_fd,
'fence_scsi': val_noop_fd,
'fence_ilo': val_ilo_fd,
@@ -1089,6 +1247,40 @@
return errors
+def val_lpar_fi(form, fenceinst):
+ errors = list()
+
+ try:
+ partition = form['partition'].strip()
+ if not partition:
+ raise Exception, 'blank'
+ fenceinst.addAttribute('partition', partition)
+ except Exception, e:
+ errors.append(FI_PROVIDE_PARTITION)
+
+ fenceinst.addAttribute('secure', '1')
+
+ return errors
+
+def val_vmware_fi(form, fenceinst):
+ errors = list()
+
+ try:
+ port = form['port'].strip()
+ if not port:
+ raise Exception, 'blank'
+ fenceinst.addAttribute('port', port)
+ except Exception, e:
+ errors.append(FI_PROVIDE_PORT)
+
+ use_ssh = form.has_key('secure') and (form['secure'] == '1' or form['secure'].lower() == 'true')
+ if use_ssh:
+ fenceinst.addAttribute('secure', '1')
+ else:
+ fenceinst.removeAttribute('secure')
+
+ return errors
+
def val_manual_fi(form, fenceinst):
nodename = form.get('nodename')
if nodename:
@@ -1112,6 +1304,8 @@
'fence_manual': val_manual_fi,
'fence_xvm': val_xvm_fi,
'fence_scsi': val_scsi_fi,
+ 'fence_lpar': val_lpar_fi,
+ 'fence_vmware': val_vmware_fi,
'fence_ilo': val_noop_fi,
'fence_ipmilan': val_noop_fi,
'fence_drac': val_noop_fi,
--- conga/luci/site/luci/Extensions/LuciClusterInfo.py 2008/11/10 21:02:43 1.10.2.7
+++ conga/luci/site/luci/Extensions/LuciClusterInfo.py 2009/02/17 20:49:01 1.10.2.8
@@ -317,10 +317,48 @@
rc_map['max_depth'] = child_depth
return child_depth + 1
-
def get_fdom_names(model):
return map(lambda x: x.getName(), model.getFailoverDomains())
+def get_svc_recovery_info(svc, model, hmap):
+ try:
+ hmap['fdoms'] = get_fdom_names(model)
+ except Exception, e:
+ if LUCI_DEBUG_MODE is True:
+ luci_log.debug_verbose('getServiceInfo1: %r %s' % (e, str(e)))
+ hmap['fdoms'] = list()
+
+ try:
+ hmap['domain'] = svc.getAttribute('domain')
+ except:
+ hmap['domain'] = None
+
+ try:
+ hmap['recovery'] = svc.getAttribute('recovery')
+ except:
+ hmap['recovery'] = None
+
+ try:
+ hmap['max_restarts'] = svc.getAttribute('max_restarts')
+ if not hmap['max_restarts']:
+ hmap['max_restarts'] = 0
+ except:
+ hmap['max_restarts'] = 0
+
+ try:
+ hmap['restart_expire_time'] = svc.getAttribute('restart_expire_time')
+ if not hmap['restart_expire_time']:
+ hmap['restart_expire_time'] = 0
+ except:
+ hmap['restart_expire_time'] = 0
+
+ try:
+ if int(svc.getAttribute('exclusive')):
+ hmap['exclusive'] = 'true'
+ else:
+ hmap['exclusive'] = 'false'
+ except:
+ hmap['exclusive'] = 'false'
def getServiceInfo(self, status, model, req):
root_uuid = 'toplevel'
@@ -332,18 +370,11 @@
if LUCI_DEBUG_MODE is True:
luci_log.debug_verbose('getServiceInfo0: no model: %r' % model)
return {}
+ cluname = fvars['clustername'] or model.getClusterName()
#set up struct for service config page
hmap = {}
- try:
- cluname = fvars['clustername'] or model.getClusterName()
- hmap['fdoms'] = get_fdom_names(model)
- except Exception, e:
- if LUCI_DEBUG_MODE is True:
- luci_log.debug_verbose('getServiceInfo1: %r %s' % (e, str(e)))
- hmap['fdoms'] = list()
-
hmap['root_uuid'] = root_uuid
# uuids for the service page needed when new resources are created
hmap['uuid_list'] = map(lambda x: make_uuid('resource'), xrange(30))
@@ -412,37 +443,7 @@
# first get service by name from model
svc = model.getService(servicename)
- try:
- hmap['domain'] = svc.getAttribute('domain')
- except:
- hmap['domain'] = None
-
- try:
- hmap['recovery'] = svc.getAttribute('recovery')
- except:
- hmap['recovery'] = None
-
- try:
- hmap['max_restarts'] = svc.getAttribute('max_restarts')
- if not hmap['max_restarts']:
- hmap['max_restarts'] = 0
- except:
- hmap['max_restarts'] = 0
-
- try:
- hmap['restart_expire_time'] = svc.getAttribute('restart_expire_time')
- if not hmap['restart_expire_time']:
- hmap['restart_expire_time'] = 0
- except:
- hmap['restart_expire_time'] = 0
-
- try:
- if int(svc.getAttribute('exclusive')):
- hmap['exclusive'] = 'true'
- else:
- hmap['exclusive'] = 'false'
- except:
- hmap['exclusive'] = 'false'
+ get_svc_recovery_info(svc, model, hmap)
resource_list = list()
if svc is not None:
@@ -601,6 +602,9 @@
clumap['os_minor'] = os_minor
if os_minor > 1:
clumap['vm_migration_choice'] = True
+ if os_minor > 2:
+ clumap['has_fence_ssh'] = True
+ clumap['has_ignore_undef_fence'] = True
elif cluster_os.find('Nahant') != -1:
clumap['os_major'] = 4
os_minor = int(cluster_os[cluster_os.find('Update ') + 7])
@@ -659,6 +663,7 @@
clumap['pjd'] = pjd
#post fail delay
clumap['pfd'] = pfd
+ clumap['skip_undefined'] = fdp.getSkipUndefined()
#-------------
#if multicast
@@ -1552,6 +1557,7 @@
attrs = vm.getAttributes()
if attrs:
vm_map.update(attrs)
+ get_svc_recovery_info(vm, model, vm_map)
return vm_map
def getResourcesInfo(self, model, request):
--- conga/luci/site/luci/Extensions/LuciValidation.py 2008/11/10 21:02:44 1.9.2.3
+++ conga/luci/site/luci/Extensions/LuciValidation.py 2009/02/17 20:49:01 1.9.2.4
@@ -867,6 +867,7 @@
elif not run_xvmd:
model.delFenceXVM()
+ fd = None
try:
fd = model.getFenceDaemonPtr()
old_pj_delay = fd.getPostJoinDelay()
@@ -882,6 +883,12 @@
luci_log.debug_verbose('Unable to update fence daemon properties: %r %s' % (e, str(e)))
errors.append('An error occurred while attempting to update fence daemon properties: %s' % str(e))
+ skip_undef = form.has_key('skip_undefined')
+ if skip_undef is True:
+ fd.setSkipUndefined(True)
+ else:
+ fd.setSkipUndefined(False)
+
if len(errors) > 0:
return (False, {'errors': errors })
--- conga/luci/site/luci/Extensions/ResourceHandler.py 2008/05/12 18:04:12 1.2.2.6
+++ conga/luci/site/luci/Extensions/ResourceHandler.py 2009/02/17 20:49:01 1.2.2.7
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 Red Hat, Inc.
+# Copyright (C) 2006-2009 Red Hat, Inc.
#
# This program is free software; you can redistribute
# it and/or modify it under the terms of version 2 of the
@@ -41,13 +41,13 @@
def generate_fsid(model, name):
import binascii
- from random import random
+ from random import randrange
fsid_list = get_fsid_list(model)
fsid = binascii.crc32(name) & 0xffff
dupe = fsid in fsid_list
while dupe is True:
- fsid = (fsid + random.randrange(1, 0xfffe)) & 0xffff
+ fsid = (fsid + randrange(1, 0xfffe)) & 0xffff
dupe = fsid in fsid_list
return fsid
--- conga/luci/site/luci/Extensions/ClusterModel/FenceDaemon.py 2008/03/25 01:27:13 1.2.2.2
+++ conga/luci/site/luci/Extensions/ClusterModel/FenceDaemon.py 2009/02/17 20:49:02 1.2.2.3
@@ -33,6 +33,16 @@
val = self.getAttribute('clean_start')
return val
+ def getSkipUndefined(self):
+ val = self.getAttribute('skip_undefined')
+ return val
+
+ def setSkipUndefined(self, val):
+ if val:
+ self.addAttribute('skip_undefined', '1')
+ else:
+ self.removeAttribute('skip_undefined')
+
def setPostJoinDelay(self, delay):
self.addAttribute('post_join_delay', delay)
--- conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py 2008/03/25 01:27:13 1.5.4.1
+++ conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py 2009/02/17 20:49:02 1.5.4.2
@@ -29,6 +29,8 @@
'fence_drac': 'Dell DRAC',
'fence_rsa': 'IBM RSA II Device',
'fence_rps10': 'RPS10 Serial Switch',
+ 'fence_lpar': 'LPAR Fencing',
+ 'fence_vmware': 'VMware Fencing',
'fence_manual': 'Manual Fencing'
}
@@ -45,6 +47,8 @@
'fence_bullpap': True,
'fence_xvm': True,
'fence_scsi': True,
+ 'fence_lpar': True,
+ 'fence_vmware': True,
'fence_ilo': False,
'fence_ipmilan': False,
'fence_drac': False,
@@ -86,6 +90,8 @@
'fence_bullpap': ( 'domain' ),
'fence_xvm': ( 'domain' ),
'fence_scsi': ( 'node' ),
+ 'fence_lpar': ( 'partition' ),
+ 'fence_vmware': ( 'port' ),
'fence_ilo': ( ),
'fence_ipmilan': ( ),
'fence_drac': ( ),
@@ -117,6 +123,10 @@
( 'name', 'ipaddr', 'login', 'passwd' ),
'fence_xvm':
( 'name' ),
+ 'fence_lpar':
+ ( 'name', 'ipaddr', 'login', 'passwd' ),
+ 'fence_vmware':
+ ( 'name', 'ipaddr', 'login', 'passwd', 'vmlogin', 'vmpasswd' ),
'fence_scsi':
( 'name' ),
'fence_ilo':
--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2008/11/10 21:02:44 1.5.2.6
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py 2009/02/17 20:49:02 1.5.2.7
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 Red Hat, Inc.
+# Copyright (C) 2006-2009 Red Hat, Inc.
#
# This program is free software; you can redistribute
# it and/or modify it under the terms of version 2 of the
@@ -1101,6 +1101,25 @@
continue
self.__removeReferences(tagobj, t)
+ def get_expected_votes(self):
+ node_votes = 0
+ qdisk_votes = 0
+
+ if self.quorumd_ptr is not None:
+ try:
+ qdisk_votes = int(self.quorumd_ptr.getVotes())
+ except:
+ qdisk_votes = 0
+
+ for i in self.getNodes():
+ try:
+ cur_votes = int(i.getVotes())
+ except:
+ cur_votes = 1
+ node_votes += cur_votes
+
+ return node_votes + qdisk_votes
+
def updateReferences(self):
self.__updateReferences(self.cluster_ptr)
def __updateReferences(self, level):
@@ -1126,21 +1145,25 @@
return True
def check_two_node(self):
- if self.getLockType() == DLM_TYPE and self.quorumd_ptr is None:
- clusternodes_count = len(self.clusternodes_ptr.getChildren())
+ if self.getLockType() == DLM_TYPE:
+ clusternodes_count = len(self.getNodes())
#Make certain that there is a cman tag in the file
#If missing, it will not hurt to add it here
if self.CMAN_ptr is None:
cman = Cman()
self.cluster_ptr.addChild(cman)
self.CMAN_ptr = cman
- if clusternodes_count == 2:
- self.CMAN_ptr.addAttribute('two_node', '1')
- self.CMAN_ptr.addAttribute('expected_votes', '1')
- else:
- if self.CMAN_ptr.getAttribute('expected_votes') in ('0', '1'):
+
+ if not self.quorumd_ptr:
+ if clusternodes_count == 2:
+ self.CMAN_ptr.addAttribute('two_node', '1')
+ self.CMAN_ptr.addAttribute('expected_votes', '1')
+ else:
+ self.CMAN_ptr.removeAttribute('two_node')
self.CMAN_ptr.removeAttribute('expected_votes')
+ else:
self.CMAN_ptr.removeAttribute('two_node')
+ self.CMAN_ptr.addAttribute('expected_votes', str(self.get_expected_votes()))
def dual_power_fence_check(self):
# if 2 or more power controllers reside in the same fence level,
--- conga/luci/site/luci/Extensions/ClusterModel/QuorumD.py 2008/03/25 01:27:13 1.2.2.2
+++ conga/luci/site/luci/Extensions/ClusterModel/QuorumD.py 2009/02/17 20:49:02 1.2.2.3
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 Red Hat, Inc.
+# Copyright (C) 2006-2009 Red Hat, Inc.
#
# This program is free software; you can redistribute
# it and/or modify it under the terms of version 2 of the
@@ -13,3 +13,12 @@
def __init__(self):
TagObject.__init__(self)
self.TAG_NAME = TAG_NAME
+
+ def getVotes(self):
+ try:
+ num_votes = self.getAttribute('votes')
+ if num_votes is not None:
+ return int(num_votes)
+ except:
+ pass
+ return 0
Binary files /cvs/cluster/conga/luci/site/luci/var/Data.fs 2008/12/10 21:02:01 1.20.2.27 and /cvs/cluster/conga/luci/site/luci/var/Data.fs 2009/02/17 20:49:02 1.20.2.28 differ
rcsdiff: /cvs/cluster/conga/luci/site/luci/var/Data.fs: diff failed
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-17 20:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-08 21:48 [Cluster-devel] conga/luci cluster/cluster_config-macros clust rmccabe
-- strict thread matches above, loose matches on Subject: below --
2009-02-17 20:49 rmccabe
2008-01-02 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).