All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] conga ./conga.spec.in.in luci/cluster/fence-ma ...
@ 2008-04-11  6:50 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2008-04-11  6:50 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2008-04-11 06:50:33

Modified files:
	.              : conga.spec.in.in 
	luci/cluster   : fence-macros 
	luci/init.d    : luci 
	luci/site/luci/var/certs: cacert.config 
	luci/utils     : luci_admin 

Log message:
	Fix 441573: "nodename" field for fence_scsi disabled when adding a new fence device/instance
	
	Generate serial numbers for self-signed certs to avoid Firefox locking us out in certain situations.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.75&r2=1.45.2.76
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/init.d/luci.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.11.2.4&r2=1.11.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/certs/cacert.config.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/utils/luci_admin.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.50.2.6&r2=1.50.2.7

--- conga/conga.spec.in.in	2008/03/24 23:18:22	1.45.2.75
+++ conga/conga.spec.in.in	2008/04/11 06:50:32	1.45.2.76
@@ -291,6 +291,9 @@
 
 ###  changelog ###
 %changelog
+* Thu Apr 10 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-7
+- Fix bz441573 ("nodename" field for fence_scsi disabled when adding a new fence device/instance)
+
 * Wed Feb 27 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-6
 - Fix bz434586 (Resource tree does not display multiple children of a parent correctly)
 - Fix bz304931 (Rich Sybase resource agent configuration support)
--- conga/luci/cluster/fence-macros	2008/01/23 04:44:30	1.2.2.1
+++ conga/luci/cluster/fence-macros	2008/04/11 06:50:32	1.2.2.2
@@ -1849,7 +1849,7 @@
 			<tr>
 				<td>Node name</td>
 				<td>
-					<input type="text" name="node" disabled="disabled"
+					<input type="text" name="node"
 						tal:attributes="value request/node | nothing" />
 				</td>
 			</tr>
--- conga/luci/init.d/luci	2008/02/07 06:52:56	1.11.2.4
+++ conga/luci/init.d/luci	2008/04/11 06:50:32	1.11.2.5
@@ -75,7 +75,7 @@
 
 	rm -f -- "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY"
 	/usr/bin/openssl genrsa -out "$HTTPS_PRIVKEY" "$KEY_BITS" >&/dev/null
-	/usr/bin/openssl req -new -x509 -key "$HTTPS_PRIVKEY" -out "$HTTPS_PUBKEY" -days "$KEY_LIFE_DAYS" -config /var/lib/luci/var/certs/cacert.config
+	/usr/bin/openssl req -new -x509 -key "$HTTPS_PRIVKEY" -out "$HTTPS_PUBKEY" -days "$KEY_LIFE_DAYS" -set_serial "$(/bin/date +%s)" -config /var/lib/luci/var/certs/cacert.config
 	/bin/chmod -- 600 "$HTTPS_PRIVKEY"
 	/bin/chmod -- 644 "$HTTPS_PUBKEY"
 	/bin/chown -- $LUCI_USER:$LUCI_GROUP "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY"
--- conga/luci/site/luci/var/certs/cacert.config	2006/06/02 00:14:28	1.1
+++ conga/luci/site/luci/var/certs/cacert.config	2008/04/11 06:50:33	1.1.2.1
@@ -6,10 +6,10 @@
 [ req_distinguished_name ]
 C                      = US
 ST                     = State or Province
-L                      = Locality
-O                      = Organization Name
-OU                     = Organizational Unit Name
-CN                     = Common Name
-emailAddress           = root at localhost
+L                      = Conga
+O                      = Conga
+OU                     = Conga
+CN                     = luci server
+emailAddress           = luci at localhost
 
 [ req_attributes ]
--- conga/luci/utils/luci_admin	2008/01/23 04:44:57	1.50.2.6
+++ conga/luci/utils/luci_admin	2008/04/11 06:50:33	1.50.2.7
@@ -10,6 +10,7 @@
 import sys, os, pwd
 from select import select
 from stat import S_ISREG
+from time import time
 import types
 import xml
 import xml.dom
@@ -1051,7 +1052,7 @@
 
 	# /usr/bin/openssl req -new -x509 -key /var/lib/luci/var/certs/privkey.pem -out /var/lib/luci/var/certs/cacert.pem -days 1825 -config /var/lib/luci/var/certs/cacert.config
 	command = '/usr/bin/openssl'
-	args = [ command, 'req', '-new', '-x509', '-key', SSL_PRIVKEY_PATH, '-out', SSL_PUBKEY_PATH, '-days', '1825', '-config', SSL_KEYCONFIG_PATH ]
+	args = [ command, 'req', '-new', '-x509', '-key', SSL_PRIVKEY_PATH, '-out', SSL_PUBKEY_PATH, '-days', '1825', '-set_serial', str(int(time())), '-config', SSL_KEYCONFIG_PATH ]
 	exec_cmd(command, args)
 
 	# take ownership and restrict access



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga ./conga.spec.in.in luci/cluster/fence-ma ...
@ 2008-04-16 20:46 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2008-04-16 20:46 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2008-04-16 20:46:41

Modified files:
	.              : conga.spec.in.in 
	luci/cluster   : fence-macros validate_fence.js 
	luci/site/luci/Extensions: FenceHandler.py 
	luci/site/luci/var: Data.fs 

Log message:
	Use the 'ipaddr' attribute, not 'hostname' for RSA and RSB fencing.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.78&r2=1.45.2.79
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.3&r2=1.2.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_fence.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.7&r2=1.1.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.11&r2=1.4.2.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/Data.fs.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.31&r2=1.15.2.32

--- conga/conga.spec.in.in	2008/04/14 15:58:35	1.45.2.78
+++ conga/conga.spec.in.in	2008/04/16 20:46:08	1.45.2.79
@@ -294,6 +294,7 @@
 * Thu Apr 10 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-8
 - Fix bz441580 (conga should install 'sg3_utils' and start service 'scsi_reserve' when scsi fencing is used)
 - Fix bz441573 ("nodename" field for fence_scsi disabled when adding a new fence device/instance)
+- Use the 'ipaddr' attribute, not 'hostname' for RSA and RSB fencing.
 
 * Wed Feb 27 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-6
 - Fix bz434586 (Resource tree does not display multiple children of a parent correctly)
--- conga/luci/cluster/fence-macros	2008/04/11 22:43:30	1.2.2.3
+++ conga/luci/cluster/fence-macros	2008/04/16 20:46:09	1.2.2.4
@@ -188,6 +188,10 @@
 		<tal:block metal:use-macro="here/fence-macros/macros/fence-form-rsa" />
 	</tal:block>
 
+	<tal:block tal:condition="python: cur_fence_type == 'fence_rsb'">
+		<tal:block metal:use-macro="here/fence-macros/macros/fence-form-rsb" />
+	</tal:block>
+
 	<tal:block tal:condition="python: cur_fence_type == 'fence_brocade'">
 		<tal:block metal:use-macro="here/fence-macros/macros/fence-form-brocade" />
 	</tal:block>
@@ -329,6 +333,7 @@
 	<option name="fence_egenera" value="fence_egenera">Egenera SAN Controller</option>
 	<option name="fence_ilo" value="fence_ilo">HP iLO</option>
 	<option name="fence_rsa" value="fence_rsa">IBM RSA II</option>
+	<option name="fence_rsb" value="fence_rsb">Fujitsu Siemens RSB</option>
 	<option name="fence_bladecenter" value="fence_bladecenter">IBM Blade Center</option>
 	<option name="fence_bullpap" value="fence_bullpap">Bull PAP</option>
 	<option name="fence_rps10" value="fence_rps10">RPS10 Serial Switch</option>
@@ -701,8 +706,8 @@
 			<tr>
 				<td>Hostname</td>
 				<td>
-					<input name="hostname" type="text"
-						tal:attributes="value cur_fencedev/hostname | nothing" />
+					<input name="ipaddr" type="text"
+						tal:attributes="value cur_fencedev/ipaddr | nothing" />
 				</td>
 			</tr>
 			<tr>
@@ -742,6 +747,66 @@
 	</div>
 </div>
 
+<div metal:define-macro="fence-form-rsb"
+	tal:attributes="id cur_fencedev/name | nothing">
+
+	<div id="fence_rsb" class="fencedev">
+		<table>
+			<tr>
+				<td><strong class="cluster">Fence Type</strong></td>
+				<td>Fujitsu Siemens RemoteView Service Board (RSB)</td>
+			</tr>
+			<tr>
+				<td>Name</td>
+				<td>
+					<input name="name" type="text"
+						tal:attributes="value cur_fencedev/name | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>Hostname</td>
+				<td>
+					<input name="ipaddr" type="text"
+						tal:attributes="value cur_fencedev/ipaddr | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>Login</td>
+				<td>
+					<input name="login" type="text"
+						tal:attributes="value cur_fencedev/login | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>Password</td>
+				<td>
+					<input name="passwd" type="password" autocomplete="off"
+						tal:attributes="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="fence_type" value="fence_rsb" />
+	</div>
+</div>
+
 <div metal:define-macro="fence-form-brocade"
 	tal:attributes="id cur_fencedev/name | nothing">
 
@@ -1376,6 +1441,7 @@
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-ilo" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-drac" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-rsa" />
+	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-rsb" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-brocade" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-sanbox2" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-vixel" />
--- conga/luci/cluster/validate_fence.js	2008/01/23 04:44:30	1.1.2.7
+++ conga/luci/cluster/validate_fence.js	2008/04/16 20:46:09	1.1.2.8
@@ -34,7 +34,8 @@
 fence_validator['manual'] = [];
 fence_validator['mcdata'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['rps10'] = [ 'device', 'port'];
-fence_validator['rsa'] = [ 'hostname', 'login', 'passwd', 'passwd_script' ];
+fence_validator['rsa'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
+fence_validator['rsb'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['sanbox2'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['scsi'] = [];
 fence_validator['unknown'] = [];
--- conga/luci/site/luci/Extensions/FenceHandler.py	2008/01/23 04:44:32	1.4.2.11
+++ conga/luci/site/luci/Extensions/FenceHandler.py	2008/04/16 20:46:09	1.4.2.12
@@ -543,10 +543,10 @@
 	errors = list()
 
 	try:
-		hostname = form['hostname'].strip()
+		hostname = form['ipaddr'].strip()
 		if not hostname:
 			raise Exception, 'blank'
-		fencedev.addAttribute('hostname', hostname)
+		fencedev.addAttribute('ipaddr', hostname)
 	except Exception, e:
 		errors.append(FD_PROVIDE_HOSTNAME)
 
@@ -822,6 +822,7 @@
 	'fence_ipmilan':		val_ipmilan_fd,
 	'fence_drac':			val_drac_fd,
 	'fence_rsa':			val_rsa_fd,
+	'fence_rsb':			val_rsa_fd, # same params as rsa
 	'fence_rps10':			val_rps10_fd,
 	'fence_manual':			val_noop_fd
 }
@@ -1082,6 +1083,7 @@
 	'fence_ipmilan':		val_noop_fi,
 	'fence_drac':			val_noop_fi,
 	'fence_rsa':			val_noop_fi,
+	'fence_rsb':			val_noop_fi,
 	'fence_rps10':			val_noop_fi
 }
 
Binary files /cvs/cluster/conga/luci/site/luci/var/Data.fs	2008/03/24 23:18:23	1.15.2.31 and /cvs/cluster/conga/luci/site/luci/var/Data.fs	2008/04/16 20:46:09	1.15.2.32 differ
rcsdiff: /cvs/cluster/conga/luci/site/luci/var/Data.fs: diff failed



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga ./conga.spec.in.in luci/cluster/fence-ma ...
@ 2008-04-21 18:16 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2008-04-21 18:16 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	rmccabe at sourceware.org	2008-04-21 18:16:01

Modified files:
	.              : conga.spec.in.in 
	luci/cluster   : fence-macros form-macros resource-form-macros 
	                 validate_fence.js 
	luci/site/luci/Extensions: FenceHandler.py LuciClusterInfo.py 
	luci/site/luci/var: Data.fs 
	make           : version.in 

Log message:
	Fix bz442729 (Add UI support for ssh for fence agents that now support it)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.67.2.26&r2=1.67.2.27
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.4.4&r2=1.2.4.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.176.2.23&r2=1.176.2.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.31.2.9&r2=1.31.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_fence.js.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.6&r2=1.3.2.7
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.8&r2=1.17.2.9
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.4&r2=1.10.2.5
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.22&r2=1.20.2.23
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/make/version.in.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.28.2.11&r2=1.28.2.12

--- conga/conga.spec.in.in	2008/04/18 04:19:57	1.67.2.26
+++ conga/conga.spec.in.in	2008/04/21 18:15:17	1.67.2.27
@@ -300,6 +300,9 @@
 
 
 %changelog
+* Fri Apr 18 2008 Ryan McCabe <rmccabe@redhat.com> 0.11.1-3
+- Fix bz442729 (Add UI support for ssh for fence agents that now support it)
+
 * Tue Mar 25 2008 Ryan McCabe <rmccabe@redhat.com> 0.11.1-2
 - Fix bz443002 (luci shows wrong state for 'Monitor link' checkbox in IP resource)
 - Fix bz442933 (Luci inserts "hostname" instead of "ipaddr" for rsa II fencing device)
--- conga/luci/cluster/fence-macros	2008/04/18 03:31:46	1.2.4.4
+++ conga/luci/cluster/fence-macros	2008/04/21 18:15:17	1.2.4.5
@@ -77,6 +77,9 @@
 
 	<h2>Add a Sharable Fence Device</h2>
 
+	<tal:block tal:define="
+		global clusterinfo python: here.getClusterInfo(modelb, request)" />
+
 	<div id="invisible" class="invisible">
 		<tal:block metal:use-macro="here/fence-macros/macros/shared-fence-form-list" />
 	</div>
@@ -136,6 +139,9 @@
 
 	<h3>Configure a Fence Device</h3>
 
+	<tal:block tal:define="
+		global clusterinfo python: here.getClusterInfo(modelb, request)" />
+
 	<tal:block tal:define="fencedevs python: here.getFenceInfo(modelb, None)">
 
 	<tal:block tal:condition="exists: fencedevs/fencedevs">
@@ -615,6 +621,19 @@
 							value cur_fencedev/passwd_script | 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_fencedev"
+						type="checkbox" name="secure"
+						tal:attributes="
+							checked python:(cur_fencedev and cur_fencedev.has_key('secure') and (cur_fencedev['secure'] == '1' or cur_fencedev['secure'].lower() == 'true')) and 'checked' or ''" />
+					<input tal:condition="not:exists:cur_fencedev"
+						type="checkbox" name="secure" />
+				</td>
+			</tr>
 		</table>
 
 		<tal:block tal:condition="exists: cur_fencedev">
@@ -675,6 +694,19 @@
 							value cur_fencedev/passwd_script | nothing" />
 				</td>
 			</tr>
+			<tr tal:condition="exists:clusterinfo/has_fence_ssh">
+				<td>
+					<span title="Enable SSH operation">Use SSH (DRAC5 only)</span>
+				</td>
+				<td>
+					<input tal:condition="exists:cur_fencedev"
+						type="checkbox" name="secure"
+						tal:attributes="
+							checked python:(cur_fencedev and cur_fencedev.has_key('secure') and (cur_fencedev['secure'] == '1' or cur_fencedev['secure'].lower() == 'true')) and 'checked' or ''" />
+					<input tal:condition="not:exists:cur_fencedev"
+						type="checkbox" name="secure" />
+				</td>
+			</tr>
 		</table>
 
 		<tal:block tal:condition="exists: cur_fencedev">
@@ -1386,10 +1418,9 @@
 			<tr>
 				<td>Use Lanplus</td>
 				<td>
-					<tal:block tal:condition="exists: cur_fencedev">
+					<tal:block tal:condition="exists:cur_fencedev">
 						<input name="lanplus" type="checkbox"
-							tal:attributes="checked python: ('lanplus' in cur_fencedev and cur_fencedev['lanplus'] == '1') and 'checked' or ''"
-						/>
+							tal:attributes="checked python: (cur_fencedev and cur_fencedev.has_key('lanplus') and (cur_fencedev['lanplus'] == '1' or cur_fencedev['lanplus'].lower() == 'true')) and 'checked' or ''" />
 					</tal:block>
 					<tal:block tal:condition="not:exists:cur_fencedev">
 						<input name="lanplus" type="checkbox" />
@@ -1532,6 +1563,19 @@
 						tal:attributes="value cur_instance/switch | 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">
@@ -1615,6 +1659,19 @@
 						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">
@@ -1843,6 +1900,19 @@
 						tal:attributes="value cur_instance/blade | 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">
--- conga/luci/cluster/form-macros	2008/03/25 01:27:10	1.176.2.23
+++ conga/luci/cluster/form-macros	2008/04/21 18:15:17	1.176.2.24
@@ -512,6 +512,9 @@
 		global cluster_node_status_str python: (nodeinfo['nodestate'] == '0' and 'Cluster member' or (nodeinfo['nodestate'] == '1' and 'Currently not a cluster participant' or 'This node is not responding'))"
 	/>
 
+	<tal:block tal:define="
+		global clusterinfo python: here.getClusterInfo(modelb, request)" />
+
 	 <table class="cluster node" width="100%">
 		<tr class="cluster node info_top">
 			<td class="cluster node node_name">
--- conga/luci/cluster/resource-form-macros	2008/04/18 04:19:57	1.31.2.9
+++ conga/luci/cluster/resource-form-macros	2008/04/21 18:15:17	1.31.2.10
@@ -146,7 +146,10 @@
 			<option name="TOMCAT-5" value="TOMCAT-5">Tomcat 5</option>
 			<option name="SAPDatabase" value="SAPDatabase">SAP Database</option>
 			<option name="SAPInstance" value="SAPInstance">SAP Instance</option>
-			<option name="ASEHAagent" value="ASEHAagent">Sybase ASE Failover Instance</option>
+
+			<tal:block tal:condition="python:clusterinfo and clusterinfo['os_major'] == 5 and clusterinfo['os_minor'] > 1">
+				<option name="ASEHAagent" value="ASEHAagent">Sybase ASE Failover Instance</option>
+			</tal:block>
 			<option name="oracledb" value="oracledb">Oracle 10g Failover Instance</option>
 		</select>
 	</form>
@@ -199,7 +202,11 @@
 			<option name="TOMCAT-5" value="TOMCAT-5">Tomcat 5</option>
 			<option name="SAPDatabase" value="SAPDatabase">SAP Database</option>
 			<option name="SAPInstance" value="SAPInstance">SAP Instance</option>
-			<option name="ASEHAagent" value="ASEHAagent">Sybase ASE Failover Instance</option>
+
+			<tal:block tal:condition="python:clusterinfo and clusterinfo['os_major'] == 5 and clusterinfo['os_minor'] > 1">
+				<option name="ASEHAagent" value="ASEHAagent">Sybase ASE Failover Instance</option>
+			</tal:block>
+
 			<option name="oracledb" value="oracledb">Oracle 10g Failover Instance</option>
 		</select>
 	</form>
--- conga/luci/cluster/validate_fence.js	2008/04/18 03:31:46	1.3.2.6
+++ conga/luci/cluster/validate_fence.js	2008/04/21 18:15:17	1.3.2.7
@@ -8,8 +8,8 @@
 */
 
 var fence_inst_validator = [];
-fence_inst_validator['apc'] = [ 'port', 'switch' ];
-fence_inst_validator['bladecenter'] = [ 'blade' ];
+fence_inst_validator['apc'] = [ 'port', 'switch', 'secure' ];
+fence_inst_validator['bladecenter'] = [ 'blade', 'secure' ];
 fence_inst_validator['brocade'] = [ 'port' ];
 fence_inst_validator['bullpap'] = [ 'domain' ];
 fence_inst_validator['egenera'] = [ 'lpan', 'pserver' ];
@@ -18,7 +18,7 @@
 fence_inst_validator['sanbox2'] = [ 'port' ];
 fence_inst_validator['scsi'] = [ 'nodename' ];
 fence_inst_validator['vixel'] = [ 'port' ];
-fence_inst_validator['wti'] = [ 'port' ];
+fence_inst_validator['wti'] = [ 'port', 'secure' ];
 fence_inst_validator['xvm'] = [ 'domain' ];
 
 var fence_validator = [];
@@ -26,10 +26,10 @@
 fence_validator['bladecenter'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['brocade'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['bullpap'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
-fence_validator['drac'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
+fence_validator['drac'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script', 'secure' ];
 fence_validator['egenera'] = [ 'cserver' ];
 fence_validator['gnbd'] = [ 'servers' ];
-fence_validator['ilo'] = [ 'hostname', 'login', 'passwd', 'passwd_script' ];
+fence_validator['ilo'] = [ 'hostname', 'login', 'passwd', 'passwd_script', 'secure' ];
 fence_validator['ipmilan'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script', 'lanplus', 'auth' ];
 fence_validator['manual'] = [];
 fence_validator['mcdata'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
@@ -77,7 +77,8 @@
 		return (errors);
 	}
 
-	if (errors && errors.length > 0 && form.passwd_script && !str_is_blank(form.passwd_script.value))
+	if (errors && errors.length > 0 &&
+		form.passwd_script && !str_is_blank(form.passwd_script.value))
 	{
 		clr_form_err(form_elem);
 		return (null);
@@ -126,6 +127,9 @@
 field_validator['port'] = validate_field_str;
 field_validator['passwd_script'] = validate_field_noop;
 
+/* iLO, DRAC5, WTI, APC, Bladecenter */
+field_validator['secure'] = validate_field_noop;
+
 /* IPMI fence device */
 field_validator['lanplus'] = validate_field_noop;
 field_validator['auth'] = validate_field_ipmilan_auth;
--- conga/luci/site/luci/Extensions/FenceHandler.py	2008/04/18 03:31:46	1.17.2.8
+++ conga/luci/site/luci/Extensions/FenceHandler.py	2008/04/21 18:15:18	1.17.2.9
@@ -654,6 +654,12 @@
 		except:
 			pass
 
+	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')
+
 	return errors
 
 def val_rps10_fd(form, fencedev):
@@ -803,6 +809,12 @@
 	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')
+
 	return errors
 
 FD_VALIDATE = {
@@ -903,6 +915,12 @@
 	except Exception, e:
 		errors.append(FI_PROVIDE_SWITCH)
 
+	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_wti_fi(form, fenceinst):
@@ -916,6 +934,12 @@
 	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_brocade_fi(form, fenceinst):
@@ -981,6 +1005,12 @@
 	except Exception, e:
 		errors.append(FI_PROVIDE_BLADE)
 
+	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_mcdata_fi(form, fenceinst):
--- conga/luci/site/luci/Extensions/LuciClusterInfo.py	2008/03/25 01:27:12	1.10.2.4
+++ conga/luci/site/luci/Extensions/LuciClusterInfo.py	2008/04/21 18:15:18	1.10.2.5
@@ -575,14 +575,24 @@
 		return {}
 
 	clumap = {}
+
 	try:
 		cluster_os = model.getClusterOS()
-		if cluster_os.find('Tikanga'):
+		if cluster_os.find('Tikanga') != -1:
+			clumap['os_major'] = 5
 			os_minor = int(cluster_os[cluster_os.find('5.') + 2])
+			clumap['os_minor'] = os_minor
 			if os_minor > 1:
 				clumap['vm_migration_choice'] = True
-	except:
-		pass
+		elif cluster_os.find('Nahant') != -1:
+			clumap['os_major'] = 4
+			os_minor = int(cluster_os[cluster_os.find('Update ') + 7])
+			clumap['os_minor'] = os_minor
+			if os_minor > 6:
+				clumap['has_fence_ssh'] = True
+	except Exception, e:
+		if LUCI_DEBUG_MODE is True:
+			luci_log.debug_verbose('GCI0a: %r %s' % (e, str(e)))
 
 	if not model:
 		try:
@@ -1626,7 +1636,9 @@
 	clu_map = {}
 
 	try:
-		os_str = resolveOSType(rc.os())
+		os_str = rc.os()
+		clu_map['os_full'] = os_str
+		os_str = resolveOSType(os_str)
 		clu_map['os'] = os_str
 		clu_map['isVirtualized'] = rc.dom0()
 	except:
Binary files /cvs/cluster/conga/luci/site/luci/var/Data.fs	2008/04/14 17:17:29	1.20.2.22 and /cvs/cluster/conga/luci/site/luci/var/Data.fs	2008/04/21 18:15:18	1.20.2.23 differ
rcsdiff: /cvs/cluster/conga/luci/site/luci/var/Data.fs: diff failed
--- conga/make/version.in	2008/04/11 06:30:25	1.28.2.11
+++ conga/make/version.in	2008/04/21 18:16:00	1.28.2.12
@@ -1,2 +1,2 @@
 VERSION=0.11.1
-RELEASE=2
+RELEASE=3



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga ./conga.spec.in.in luci/cluster/fence-ma ...
@ 2008-04-23 17:27 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2008-04-23 17:27 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2008-04-23 17:27:53

Modified files:
	.              : conga.spec.in.in 
	luci/cluster   : fence-macros form-macros resource-form-macros 
	                 validate_fence.js 
	luci/site/luci/Extensions: FenceHandler.py LuciClusterInfo.py 
	                           homebase_adapters.py 
	luci/site/luci/var: Data.fs 

Log message:
	foward port fixes from RHEL4

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.82&r2=1.45.2.83
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.4&r2=1.2.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.90.2.34&r2=1.90.2.35
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21.2.11&r2=1.21.2.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_fence.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.8&r2=1.1.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.12&r2=1.4.2.13
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.9&r2=1.1.4.10
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.34.2.16&r2=1.34.2.17
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/Data.fs.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.15.2.32&r2=1.15.2.33

--- conga/conga.spec.in.in	2008/04/18 20:34:50	1.45.2.82
+++ conga/conga.spec.in.in	2008/04/23 17:27:10	1.45.2.83
@@ -291,13 +291,15 @@
 
 ###  changelog ###
 %changelog
-* Thu Apr 10 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-8
-- Fix bz443152 (Exception generated when adding or updating failover domains)
+-* Fri Apr 18 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-8
 - Fix bz441580 (conga should install 'sg3_utils' and start service 'scsi_reserve' when scsi fencing is used)
 - Fix bz441573 ("nodename" field for fence_scsi disabled when adding a new fence device/instance)
 - Fix bz442997 (Luci inserts "hostname" instead of "ipaddr" for rsa II fencing device)
 - Fix bz442806 (luci shows wrong state for 'Monitor link' checkbox in IP resource)
 
+* Fri Apr 18 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-7
+- Fix a bug introduced while implementing bz337041 (Add option to not fail-back service)
+
 * Wed Feb 27 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-6
 - Fix bz434586 (Resource tree does not display multiple children of a parent correctly)
 - Fix bz304931 (Rich Sybase resource agent configuration support)
--- conga/luci/cluster/fence-macros	2008/04/16 20:46:09	1.2.2.4
+++ conga/luci/cluster/fence-macros	2008/04/23 17:27:10	1.2.2.5
@@ -77,6 +77,9 @@
 
 	<h2>Add a Sharable Fence Device</h2>
 
+	<tal:block tal:define="
+		global clusterinfo python: here.getClusterInfo(modelb, request)" />
+
 	<div id="invisible" class="invisible">
 		<tal:block metal:use-macro="here/fence-macros/macros/shared-fence-form-list" />
 	</div>
@@ -136,6 +139,9 @@
 
 	<h3>Configure a Fence Device</h3>
 
+	<tal:block tal:define="
+		global clusterinfo python: here.getClusterInfo(modelb, request)" />
+
 	<tal:block tal:define="fencedevs python: here.getFenceInfo(modelb, None)">
 
 	<tal:block tal:condition="exists: fencedevs/fencedevs">
@@ -615,6 +621,19 @@
 							value cur_fencedev/passwd_script | 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_fencedev"
+						type="checkbox" name="secure"
+						tal:attributes="
+							checked python:(cur_fencedev and cur_fencedev.has_key('secure') and (cur_fencedev['secure'] == '1' or cur_fencedev['secure'].lower() == 'true')) and 'checked' or ''" />
+					<input tal:condition="not:exists:cur_fencedev"
+						type="checkbox" name="secure" />
+				</td>
+			</tr>
 		</table>
 
 		<tal:block tal:condition="exists: cur_fencedev">
@@ -675,6 +694,19 @@
 							value cur_fencedev/passwd_script | nothing" />
 				</td>
 			</tr>
+			<tr tal:condition="exists:clusterinfo/has_fence_ssh">
+				<td>
+					<span title="Enable SSH operation">Use SSH (DRAC5 only)</span>
+				</td>
+				<td>
+					<input tal:condition="exists:cur_fencedev"
+						type="checkbox" name="secure"
+						tal:attributes="
+							checked python:(cur_fencedev and cur_fencedev.has_key('secure') and (cur_fencedev['secure'] == '1' or cur_fencedev['secure'].lower() == 'true')) and 'checked' or ''" />
+					<input tal:condition="not:exists:cur_fencedev"
+						type="checkbox" name="secure" />
+				</td>
+			</tr>
 		</table>
 
 		<tal:block tal:condition="exists: cur_fencedev">
@@ -1386,10 +1418,9 @@
 			<tr>
 				<td>Use Lanplus</td>
 				<td>
-					<tal:block tal:condition="exists: cur_fencedev">
+					<tal:block tal:condition="exists:cur_fencedev">
 						<input name="lanplus" type="checkbox"
-							tal:attributes="checked python: ('lanplus' in cur_fencedev and cur_fencedev['lanplus'] == '1') and 'checked' or ''"
-						/>
+							tal:attributes="checked python: (cur_fencedev and cur_fencedev.has_key('lanplus') and (cur_fencedev['lanplus'] == '1' or cur_fencedev['lanplus'].lower() == 'true')) and 'checked' or ''" />
 					</tal:block>
 					<tal:block tal:condition="not:exists:cur_fencedev">
 						<input name="lanplus" type="checkbox" />
@@ -1532,6 +1563,19 @@
 						tal:attributes="value cur_instance/switch | 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">
@@ -1615,6 +1659,19 @@
 						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">
@@ -1843,6 +1900,19 @@
 						tal:attributes="value cur_instance/blade | 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">
--- conga/luci/cluster/form-macros	2008/02/08 21:56:33	1.90.2.34
+++ conga/luci/cluster/form-macros	2008/04/23 17:27:10	1.90.2.35
@@ -512,6 +512,9 @@
 		global cluster_node_status_str python: (nodeinfo['nodestate'] == '0' and 'Cluster member' or (nodeinfo['nodestate'] == '1' and 'Currently not a cluster participant' or 'This node is not responding'))"
 	/>
 
+	<tal:block tal:define="
+		global clusterinfo python: here.getClusterInfo(modelb, request)" />
+
 	 <table class="cluster node" width="100%">
 		<tr class="cluster node info_top">
 			<td class="cluster node node_name">
--- conga/luci/cluster/resource-form-macros	2008/04/18 04:15:52	1.21.2.11
+++ conga/luci/cluster/resource-form-macros	2008/04/23 17:27:10	1.21.2.12
@@ -146,7 +146,10 @@
 			<option name="TOMCAT-5" value="TOMCAT-5">Tomcat 5</option>
 			<option name="SAPDatabase" value="SAPDatabase">SAP Database</option>
 			<option name="SAPInstance" value="SAPInstance">SAP Instance</option>
-			<option name="ASEHAagent" value="ASEHAagent">Sybase ASE Failover Instance</option>
+
+			<tal:block tal:condition="python:clusterinfo and clusterinfo['os_major'] == 5 and clusterinfo['os_minor'] > 1">
+				<option name="ASEHAagent" value="ASEHAagent">Sybase ASE Failover Instance</option>
+			</tal:block>
 			<option name="oracledb" value="oracledb">Oracle 10g Failover Instance</option>
 		</select>
 	</form>
@@ -199,7 +202,11 @@
 			<option name="TOMCAT-5" value="TOMCAT-5">Tomcat 5</option>
 			<option name="SAPDatabase" value="SAPDatabase">SAP Database</option>
 			<option name="SAPInstance" value="SAPInstance">SAP Instance</option>
-			<option name="ASEHAagent" value="ASEHAagent">Sybase ASE Failover Instance</option>
+
+			<tal:block tal:condition="python:clusterinfo and clusterinfo['os_major'] == 5 and clusterinfo['os_minor'] > 1">
+				<option name="ASEHAagent" value="ASEHAagent">Sybase ASE Failover Instance</option>
+			</tal:block>
+
 			<option name="oracledb" value="oracledb">Oracle 10g Failover Instance</option>
 		</select>
 	</form>
--- conga/luci/cluster/validate_fence.js	2008/04/16 20:46:09	1.1.2.8
+++ conga/luci/cluster/validate_fence.js	2008/04/23 17:27:10	1.1.2.9
@@ -8,17 +8,17 @@
 */
 
 var fence_inst_validator = [];
-fence_inst_validator['apc'] = [ 'port', 'switch' ];
-fence_inst_validator['bladecenter'] = [ 'blade' ];
+fence_inst_validator['apc'] = [ 'port', 'switch', 'secure' ];
+fence_inst_validator['bladecenter'] = [ 'blade', 'secure' ];
 fence_inst_validator['brocade'] = [ 'port' ];
 fence_inst_validator['bullpap'] = [ 'domain' ];
 fence_inst_validator['egenera'] = [ 'lpan', 'pserver' ];
-fence_inst_validator['gndb'] = [ 'ipaddress' ];
+fence_inst_validator['gnbd'] = [ 'ipaddress' ];
 fence_inst_validator['mcdata'] = [ 'port' ];
 fence_inst_validator['sanbox2'] = [ 'port' ];
 fence_inst_validator['scsi'] = [ 'nodename' ];
 fence_inst_validator['vixel'] = [ 'port' ];
-fence_inst_validator['wti'] = [ 'port' ];
+fence_inst_validator['wti'] = [ 'port', 'secure' ];
 fence_inst_validator['xvm'] = [ 'domain' ];
 
 var fence_validator = [];
@@ -26,10 +26,10 @@
 fence_validator['bladecenter'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['brocade'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['bullpap'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
-fence_validator['drac'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
+fence_validator['drac'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script', 'secure' ];
 fence_validator['egenera'] = [ 'cserver' ];
 fence_validator['gnbd'] = [ 'servers' ];
-fence_validator['ilo'] = [ 'hostname', 'login', 'passwd', 'passwd_script' ];
+fence_validator['ilo'] = [ 'hostname', 'login', 'passwd', 'passwd_script', 'secure' ];
 fence_validator['ipmilan'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script', 'lanplus', 'auth' ];
 fence_validator['manual'] = [];
 fence_validator['mcdata'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
@@ -77,7 +77,8 @@
 		return (errors);
 	}
 
-	if (errors && errors.length > 0 && form.passwd_script && !str_is_blank(form.passwd_script.value))
+	if (errors && errors.length > 0 &&
+		form.passwd_script && !str_is_blank(form.passwd_script.value))
 	{
 		clr_form_err(form_elem);
 		return (null);
@@ -126,6 +127,9 @@
 field_validator['port'] = validate_field_str;
 field_validator['passwd_script'] = validate_field_noop;
 
+/* iLO, DRAC5, WTI, APC, Bladecenter */
+field_validator['secure'] = validate_field_noop;
+
 /* IPMI fence device */
 field_validator['lanplus'] = validate_field_noop;
 field_validator['auth'] = validate_field_ipmilan_auth;
--- conga/luci/site/luci/Extensions/FenceHandler.py	2008/04/16 20:46:09	1.4.2.12
+++ conga/luci/site/luci/Extensions/FenceHandler.py	2008/04/23 17:27:10	1.4.2.13
@@ -654,6 +654,12 @@
 		except:
 			pass
 
+	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')
+
 	return errors
 
 def val_rps10_fd(form, fencedev):
@@ -803,6 +809,12 @@
 	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')
+
 	return errors
 
 FD_VALIDATE = {
@@ -903,6 +915,12 @@
 	except Exception, e:
 		errors.append(FI_PROVIDE_SWITCH)
 
+	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_wti_fi(form, fenceinst):
@@ -916,6 +934,12 @@
 	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_brocade_fi(form, fenceinst):
@@ -981,6 +1005,12 @@
 	except Exception, e:
 		errors.append(FI_PROVIDE_BLADE)
 
+	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_mcdata_fi(form, fenceinst):
--- conga/luci/site/luci/Extensions/LuciClusterInfo.py	2008/01/23 04:44:32	1.1.4.9
+++ conga/luci/site/luci/Extensions/LuciClusterInfo.py	2008/04/23 17:27:10	1.1.4.10
@@ -575,14 +575,24 @@
 		return {}
 
 	clumap = {}
+
 	try:
 		cluster_os = model.getClusterOS()
-		if cluster_os.find('Tikanga'):
+		if cluster_os.find('Tikanga') != -1:
+			clumap['os_major'] = 5
 			os_minor = int(cluster_os[cluster_os.find('5.') + 2])
+			clumap['os_minor'] = os_minor
 			if os_minor > 1:
 				clumap['vm_migration_choice'] = True
-	except:
-		pass
+		elif cluster_os.find('Nahant') != -1:
+			clumap['os_major'] = 4
+			os_minor = int(cluster_os[cluster_os.find('Update ') + 7])
+			clumap['os_minor'] = os_minor
+			if os_minor > 6:
+				clumap['has_fence_ssh'] = True
+	except Exception, e:
+		if LUCI_DEBUG_MODE is True:
+			luci_log.debug_verbose('GCI0a: %r %s' % (e, str(e)))
 
 	if not model:
 		try:
@@ -1626,7 +1636,9 @@
 	clu_map = {}
 
 	try:
-		os_str = resolveOSType(rc.os())
+		os_str = rc.os()
+		clu_map['os_full'] = os_str
+		os_str = resolveOSType(os_str)
 		clu_map['os'] = os_str
 		clu_map['isVirtualized'] = rc.dom0()
 	except:
--- conga/luci/site/luci/Extensions/homebase_adapters.py	2008/02/07 06:52:56	1.34.2.16
+++ conga/luci/site/luci/Extensions/homebase_adapters.py	2008/04/23 17:27:10	1.34.2.17
@@ -629,29 +629,29 @@
 					luci_log.debug_verbose('VAC5: %s' % err_msg)
 				continue
 
-			cur_os = resolveOSType(rc.os())
-			if cur_os != cluster_os:
-				if LUCI_DEBUG_MODE is True:
-					luci_log.debug_verbose('VAC5a: "%s" / "%s" -> "%s"' \
-						% (cluster_os, rc.os(), cur_os))
-				incomplete = True
-				cur_system['errors'] = True
-
-				if not prev_auth:
-					try:
-						rc.unauth()
-					except Exception, e:
-						if LUCI_DEBUG_MODE is True:
-							luci_log.debug_verbose('VAC6: %s: %r %s' \
-								% (cur_host, e, str(e)))
-
-				err_msg = 'Node %s reports its cluster version is %s and we expect %s' \
-					% (cur_host, cur_os, cluster_os)
-
-				errors.append(err_msg)
-				if LUCI_DEBUG_MODE is True:
-					luci_log.debug_verbose('VAC7: %s' % err_msg)
-				continue
+			#cur_os = resolveOSType(rc.os())
+			#if cur_os != cluster_os:
+			#	if LUCI_DEBUG_MODE is True:
+			#		luci_log.debug_verbose('VAC5a: "%s" / "%s" -> "%s"' \
+			#			% (cluster_os, rc.os(), cur_os))
+			#	incomplete = True
+			#	cur_system['errors'] = True
+
+			#	if not prev_auth:
+			#		try:
+			#			rc.unauth()
+			#		except Exception, e:
+			#			if LUCI_DEBUG_MODE is True:
+			#				luci_log.debug_verbose('VAC6: %s: %r %s' \
+			#					% (cur_host, e, str(e)))
+
+			#	err_msg = 'Node %s reports its cluster version is %s and we expect %s' \
+			#		% (cur_host, cur_os, cluster_os)
+
+			#	errors.append(err_msg)
+			#	if LUCI_DEBUG_MODE is True:
+			#		luci_log.debug_verbose('VAC7: %s' % err_msg)
+			#	continue
 		else:
 			incomplete = True
 
Binary files /cvs/cluster/conga/luci/site/luci/var/Data.fs	2008/04/16 20:46:09	1.15.2.32 and /cvs/cluster/conga/luci/site/luci/var/Data.fs	2008/04/23 17:27:10	1.15.2.33 differ
rcsdiff: /cvs/cluster/conga/luci/site/luci/var/Data.fs: diff failed



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga ./conga.spec.in.in luci/cluster/fence-ma ...
@ 2009-02-11 16:29 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2009-02-11 16:29 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2009-02-11 16:29:37

Modified files:
	.              : conga.spec.in.in 
	luci/cluster   : fence-macros 
	luci/site/luci/Extensions: FenceHandler.py LuciClusterInfo.py 

Log message:
	- Fiz bz466013 (Add luci GUI support for LPAR and vmware fencing)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.110&r2=1.45.2.111
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.8&r2=1.2.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.14&r2=1.4.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.13&r2=1.1.4.14

--- conga/conga.spec.in.in	2009/01/29 16:22:08	1.45.2.110
+++ conga/conga.spec.in.in	2009/02/11 16:29:36	1.45.2.111
@@ -328,6 +328,10 @@
 - Fix bz467464 (adding qdisk to existing cluster fails to update cman entry in cluster.conf)
 - Fix bz460038 (Conga fs resource error when editing service)
 - Fix bz483067 (adding resource in conga doesn't work in IE)
+- Fix bz483775 (Failover Domains can't be set for VMs as services of cluster suite using Conga)
+- Fix bz483769 (Conga always shows VM properties as "Run exclusive")
+- Fix bz450007 (cannot remove shared fence device through luci)
+- Fiz bz466013 (Add luci GUI support for LPAR and vmware fencing)
 
 * Thu Sep 25 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.1-7
 - Fix a typo in the fix for bz459562
--- conga/luci/cluster/fence-macros	2008/08/18 16:53:17	1.2.2.8
+++ conga/luci/cluster/fence-macros	2009/02/11 16:29:37	1.2.2.9
@@ -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>
@@ -323,8 +331,10 @@
 	<option name="fence_egenera" value="fence_egenera">Egenera SAN Controller</option>
 	<option name="fence_bladecenter" value="fence_bladecenter">IBM Blade Center</option>
 	<option name="fence_bullpap" value="fence_bullpap">Bull PAP</option>
+	<option name="fence_vmware" value="fence_vmware">VMWare Fencing</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_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,139 @@
 	</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"
+						disabled cur_fencedev/isShared | nothing;
+						tal:attributes="value cur_fencedev/ipaddr | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>Login</td>
+				<td>
+					<input name="login" type="text"
+						disabled cur_fencedev/isShared | nothing;
+						tal:attributes="value cur_fencedev/login | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>Password</td>
+				<td>
+					<input name="passwd" type="password" autocomplete="off"
+						disabled cur_fencedev/isShared | nothing;
+						tal:attributes="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="secure" value="1" />
+		<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"
+						disabled cur_fencedev/isShared | nothing;
+						tal:attributes="value cur_fencedev/ipaddr | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>Login</td>
+				<td>
+					<input name="login" type="text"
+						disabled cur_fencedev/isShared | nothing;
+						tal:attributes="value cur_fencedev/login | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>Password</td>
+				<td>
+					<input name="passwd" type="password" autocomplete="off"
+						disabled cur_fencedev/isShared | nothing;
+						tal:attributes="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_vmware" />
+	</div>
+</div>
+
 <div metal:define-macro="fence-form-egenera"
 	tal:attributes="id cur_fencedev/name | nothing">
 
@@ -1609,6 +1754,86 @@
 	</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 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>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_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 +2278,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 +2346,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/site/luci/Extensions/FenceHandler.py	2008/06/13 18:37:46	1.4.2.14
+++ conga/luci/site/luci/Extensions/FenceHandler.py	2009/02/11 16:29:37	1.4.2.15
@@ -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,165 @@
 
 	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)
+
+	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')
+
+	return errors
+
 def val_noop_fd(dummy, _dummy):
 	return []
 
@@ -830,6 +992,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 +1253,32 @@
 
 	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)
+
+	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)
+
+	return errors
+
 def val_manual_fi(form, fenceinst):
 	nodename = form.get('nodename')
 	if nodename:
@@ -1112,6 +1302,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/08/07 18:07:37	1.1.4.13
+++ conga/luci/site/luci/Extensions/LuciClusterInfo.py	2009/02/11 16:29:37	1.1.4.14
@@ -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,8 @@
 			clumap['os_minor'] = os_minor
 			if os_minor > 1:
 				clumap['vm_migration_choice'] = True
+			if os_minor > 2:
+				clumap['has_fence_ssh'] = True
 		elif cluster_os.find('Nahant') != -1:
 			clumap['os_major'] = 4
 			os_minor = int(cluster_os[cluster_os.find('Update ') + 7])
@@ -1552,6 +1555,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):



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-02-11 16:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 16:29 [Cluster-devel] conga ./conga.spec.in.in luci/cluster/fence-ma rmccabe
  -- strict thread matches above, loose matches on Subject: below --
2008-04-23 17:27 rmccabe
2008-04-21 18:16 rmccabe
2008-04-16 20:46 rmccabe
2008-04-11  6:50 rmccabe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.