Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > d536e3b2143fe88c174c968d683c0f4f > files > 37

conga-0.12.2-24.el5_6.1.src.rpm

diff -ur a/luci/cluster/fence-macros b/luci/cluster/fence-macros
--- a/luci/cluster/fence-macros	2010-09-27 02:15:18.000000000 -0400
+++ b/luci/cluster/fence-macros	2010-09-27 03:43:29.000000000 -0400
@@ -266,6 +266,10 @@
 		<tal:block metal:use-macro="here/fence-macros/macros/fence-form-ifmib" />
 	</tal:block>
 
+	<tal:block tal:condition="python: cur_fence_type == 'fence_ucs'">
+		<tal:block metal:use-macro="here/fence-macros/macros/fence-form-ucs" />
+	</tal:block>
+
 	<tal:block tal:condition="python: cur_fence_type == 'fence_manual'">
 		<tal:block metal:use-macro="here/fence-macros/macros/fence-form-manual" />
 	</tal:block>
@@ -352,6 +356,7 @@
 	<option name="fence_vmware" value="fence_vmware">VMware Fencing</option>
 	<option name="fence_lpar" value="fence_lpar">LPAR Fencing</option>
 	<option name="fence_cisco_mds" value="fence_cisco_mds">Cisco MDS</option>
+	<option name="fence_ucs" value="fence_ucs">Cisco UCS</option>
 	<option name="fence_ifmib" value="fence_ifmib">IF MIB</option>
 </div>
 
@@ -379,6 +384,7 @@
 	<option name="fence_vmware" value="fence_vmware">VMware Fencing</option>
 	<option name="fence_lpar" value="fence_lpar">LPAR Fencing</option>
 	<option name="fence_cisco_mds" value="fence_cisco_mds">Cisco MDS</option>
+	<option name="fence_ucs" value="fence_ucs">Cisco UCS</option>
 	<option name="fence_ifmib" value="fence_ifmib">IF MIB</option>
 	<option name="fence_manual" value="fence_manual">Manual Fencing</option>
 </div>
@@ -1838,6 +1844,94 @@
 	</div>
 </div>
 
+<div metal:define-macro="fence-form-ucs"
+	tal:attributes="id cur_fencedev/name | nothing">
+
+	<div id="fence_ucs" class="fencedev">
+		<table>
+			<tr>
+				<td><strong class="cluster">Fence Type</strong></td>
+				<td>Cisco UCS</td>
+			</tr>
+			<tr>
+				<td>Name</td>
+				<td>
+					<input name="name" type="text"
+						tal:attributes="value cur_fencedev/name | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>IP Address</td>
+				<td>
+					<input name="ipaddr" type="text"
+						tal:attributes="value cur_fencedev/ipaddr | nothing" />
+				</td>
+			</tr>
+			<tr>
+				<td>IP port (optional)</td>
+				<td>
+					<input name="ipport" type="text" class="text"
+						tal:attributes="value cur_fencedev/ipport | 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 cur_fencedev/passwd | 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>Use SSL connections</td>
+				<td>
+					<input tal:condition="exists:cur_fencedev"
+						type="checkbox" name="ssl"
+						tal:attributes="
+							checked python:(cur_fencedev and cur_fencedev.has_key('ssl') and (cur_fencedev['ssl'] == '1' or cur_fencedev['ssl'].lower() == 'true')) and 'checked' or ''" />
+					<input tal:condition="not:exists:cur_fencedev"
+						type="checkbox" name="ssl" />
+				</td>
+			</tr>
+			<tr>
+				<td>Power wait (seconds)</td>
+				<td>
+					<input type="text" name="power_wait"
+						tal:attributes="
+							disabled cur_fencedev/isShared | nothing;
+							value cur_fencedev/power_wait | 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_ucs" />
+		<input type="hidden" name="sharable" value="1" />
+	</div>
+</div>
+
 <div metal:define-macro="fence-form-ifmib"
 	tal:attributes="id cur_fencedev/name | nothing">
 
@@ -2268,6 +2362,7 @@
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-vmware" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-ifmib" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-cisco_mds" />
+	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-ucs" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-manual" />
 </div>
 
@@ -2288,6 +2383,7 @@
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-vmware" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-ifmib" />
 	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-cisco_mds" />
+	<tal:block metal:use-macro="here/fence-macros/macros/fence-form-ucs" />
 </div>
 
 <div metal:define-macro="shared-fence-device-list">
@@ -2899,6 +2995,44 @@
 	</div>
 </div>
 
+<div metal:define-macro="fence-instance-form-ucs"
+	tal:omit-tag="exists: cur_fence_dev_id">
+	<div id="fence_ucs_instance" name="fence_ucs" 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><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_ucs" />
+		<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-ifmib"
 	tal:omit-tag="exists: cur_fence_dev_id">
 	<div id="fence_ifmib_instance" name="fence_ifmib" class="fencedev_instance"
@@ -3008,6 +3142,9 @@
 		metal:use-macro="here/fence-macros/macros/fence-instance-form-cisco_mds" />
 	<tal:block
 		metal:use-macro="here/fence-macros/macros/fence-instance-form-ifmib" />
+
+	<tal:block
+		metal:use-macro="here/fence-macros/macros/fence-instance-form-ucs" />
 </div>
 
 <div metal:define-macro="fencedev-instance-cond-ladder"
@@ -3092,6 +3229,11 @@
 		<tal:block
 			metal:use-macro="here/fence-macros/macros/fence-instance-form-ifmib" />
 	</tal:block>
+
+	<tal:block tal:condition="python: cur_fence_type == 'fence_ucs'">
+		<tal:block
+			metal:use-macro="here/fence-macros/macros/fence-instance-form-ucs" />
+	</tal:block>
 </div>
 
 </body>
diff -ur a/luci/cluster/validate_fence.js b/luci/cluster/validate_fence.js
--- a/luci/cluster/validate_fence.js	2010-09-27 02:15:18.000000000 -0400
+++ b/luci/cluster/validate_fence.js	2010-09-27 03:45:07.000000000 -0400
@@ -24,6 +24,7 @@
 fence_inst_validator['vmware'] = [ 'port' ];
 fence_inst_validator['cisco_mds'] = [ 'port' ];
 fence_inst_validator['ifmib'] = [ 'port' ];
+fence_inst_validator['ucs'] = [ 'port' ];
 
 var fence_validator = [];
 fence_validator['apc'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
@@ -49,6 +50,7 @@
 fence_validator['lpar'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['cisco_mds'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['ifmib'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
+fence_validator['ucs'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ];
 fence_validator['vmware'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script', 'vmlogin' ];
 fence_validator['xvm'] = [];
 
diff -ur a/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py b/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py
--- a/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py	2010-09-27 02:15:18.000000000 -0400
+++ b/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py	2010-09-27 03:00:55.000000000 -0400
@@ -33,6 +33,7 @@
 	'fence_lpar':			'LPAR Fencing',
 	'fence_vmware':			'VMware Fencing',
 	'fence_cisco_mds':		'Cisco MDS',
+	'fence_ucs':			'Cisco UCS',
 	'fence_ifmib':			'IF MIB',
 	'fence_manual':			'Manual Fencing'
 }
@@ -53,6 +54,7 @@
 	'fence_lpar':			True,
 	'fence_vmware':			True,
 	'fence_cisco_mds':		True,
+	'fence_ucs':			True,
 	'fence_ifmib':			True,
 	'fence_ilo':			False,
 	'fence_ilo_mp':			False,
@@ -99,6 +101,7 @@
 	'fence_lpar':			( 'partition' ),
 	'fence_vmware':			( 'port' ),
 	'fence_cisco_mds':		( 'port' ),
+	'fence_ucs':			( 'port' ),
 	'fence_ifmib':			( 'port' ),
 	'fence_ilo':			( ),
 	'fence_ipmilan':		( ),
@@ -137,6 +140,8 @@
 		( 'name', 'ipaddr', 'login', 'passwd', 'vmlogin', 'vmpasswd' ),
 	'fence_cisco_mds':
 		( 'name', 'ipaddr', 'login', 'passwd' ),
+	'fence_ucs':
+		( 'name', 'ipaddr', 'login', 'passwd' ),
 	'fence_ifmib':
 		( 'name', 'ipaddr', 'login', 'passwd' ),
 	'fence_scsi':
diff -ur a/luci/site/luci/Extensions/FenceHandler.py b/luci/site/luci/Extensions/FenceHandler.py
--- a/luci/site/luci/Extensions/FenceHandler.py	2010-09-27 02:15:18.000000000 -0400
+++ b/luci/site/luci/Extensions/FenceHandler.py	2010-09-27 03:55:12.000000000 -0400
@@ -776,6 +776,97 @@
 
 	return errors
 
+def val_ucs_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)
+
+	try:
+		power_wait = form['power_wait'].strip()
+		if power_wait:
+			power_wait = int(power_wait)
+			if power_wait < 0:
+				raise ValueError
+	except (KeyError, AttributeError), e:
+		power_wait = None
+	except Exception, e:
+		power_wait = None
+		errors.append('An invalid value for power_wait was given: "%s"' % form['power_wait'])
+	if power_wait:
+		fencedev.addAttribute('power_wait', str(power_wait))
+	else:
+		fencedev.removeAttribute('power_wait')
+
+	try:
+		ipport = form['ipport'].strip()
+		if ipport:
+			ipport = int(ipport)
+			if ipport < 1 or ipport & 0xffff != ipport:
+				raise ValueError
+	except (KeyError, AttributeError), e:
+		ipport = None
+	except Exception, e:
+		ipport = None
+		errors.append('An invalid value for ipport was given: "%s"' % form['ipport'])
+	if ipport:
+		fencedev.addAttribute('ipport', str(ipport))
+	else:
+		fencedev.removeAttribute('ipport')
+
+	use_ssl = form.has_key('ssl') and form['ssl'].lower() in ('1', 'on', 'true')
+	if use_ssl:
+		fencedev.addAttribute('ssl', '1')
+	else:
+		fencedev.removeAttribute('ssl')
+
+	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_cisco_mds_fd(form, fencedev):
 	errors = list()
 
@@ -1385,6 +1476,7 @@
 	'fence_egenera':		val_egenera_fd,
 	'fence_bullpap':		val_bullpap_fd,
 	'fence_lpar':			val_lpar_fd,
+	'fence_ucs':			val_ucs_fd,
 	'fence_cisco_mds':		val_cisco_mds_fd,
 	'fence_ifmib':			val_cisco_mds_fd,
 	'fence_vmware':			val_vmware_fd,
@@ -1703,6 +1795,19 @@
 
 	return errors
 
+def val_ucs_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:
@@ -1727,6 +1832,7 @@
 	'fence_xvm':			val_xvm_fi,
 	'fence_scsi':			val_scsi_fi,
 	'fence_lpar':			val_lpar_fi,
+	'fence_ucs':			val_ucs_fi,
 	'fence_cisco_mds':		val_cisco_mds_fi,
 	'fence_ifmib':			val_cisco_mds_fi,
 	'fence_vmware':			val_vmware_fi,