[Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ...

rmccabe at sourceware.org rmccabe at sourceware.org
Mon Jan 15 18:21:51 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2007-01-15 18:21:50

Modified files:
	luci/cluster   : form-macros 
	luci/site/luci/Extensions: FenceHandler.py cluster_adapters.py 
	                           conga_constants.py 

Log message:
	changes related to bz212021 that address bugs found during testing of the original fix

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.90.2.15&r2=1.90.2.16
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.2&r2=1.4.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.120.2.18&r2=1.120.2.19
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.19.2.6&r2=1.19.2.7

--- conga/luci/cluster/form-macros	2007/01/10 23:49:18	1.90.2.15
+++ conga/luci/cluster/form-macros	2007/01/15 18:21:50	1.90.2.16
@@ -2046,7 +2046,7 @@
 			<tr>
 				<td>Authentication Type</td>
 				<td>
-					<input name="auth_type" type="text" title="Options are to leave blank for none, password, md2, or md5"
+					<input name="auth_type" type="text" title="Options are to leave blank for none, password, or md5"
 						tal:attributes="value cur_fencedev/auth_type | nothing" />
 				</td>
 			</tr>
@@ -2751,6 +2751,17 @@
 				<input type="submit" value="Go"/>
 				</form>
 			</td>
+
+			<td class="cluster node node_action"
+				tal:condition="python: nodeinfo['nodestate'] != '0' and nodeinfo['nodestate'] != '1'">
+				<form method="post" onSubmit="return dropdown(this.gourl)">
+				<select name="gourl">
+					<option value="">Choose a Task...</option>
+					<option tal:attributes="value nodeinfo/fence_url | nothing">Fence this node</option>
+				</select>
+				<input type="submit" value="Go"/>
+				</form>
+			</td>
 		</tr>
 
 		<tr class="cluster node info_middle">
@@ -3143,6 +3154,15 @@
 						<input type="submit" value="Go"/>
 					</form>
 				</td>
+				<td class="node node_action" tal:condition="python: nd['status'] != '0' and nd['status'] != '1'">
+					<form method="post" onSubmit="return dropdown(this.gourl)">
+						<select class="node" name="gourl">
+							<option value="">Choose a Task...</option>
+							<option tal:attributes="value nd/fence_it_url | nothing">Fence this node</option>
+						</select>
+						<input type="submit" value="Go"/>
+					</form>
+				</td>
 			</tr>
 
 			<tr class="node info_middle">
--- conga/luci/site/luci/Extensions/FenceHandler.py	2006/12/22 17:50:16	1.4.2.2
+++ conga/luci/site/luci/Extensions/FenceHandler.py	2007/01/15 18:21:50	1.4.2.3
@@ -1058,7 +1058,7 @@
 
   if agent_type == "fence_apc":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1066,7 +1066,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1082,11 +1082,11 @@
 
   elif agent_type == "fence_wti":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1101,7 +1101,7 @@
 
   elif agent_type == "fence_brocade":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1109,7 +1109,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1125,11 +1125,11 @@
 
   elif agent_type == "fence_vixel":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1145,7 +1145,7 @@
 
   elif agent_type == "fence_mcdata":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1153,7 +1153,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1199,7 +1199,7 @@
 
   elif agent_type == "fence_sanbox2":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1207,7 +1207,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1223,7 +1223,7 @@
 
   elif agent_type == "fence_bladecenter":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1231,7 +1231,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1247,7 +1247,7 @@
 
   elif agent_type == "fence_bullpap":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1255,7 +1255,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1295,6 +1295,7 @@
 def validateFenceDevice(form, model): 
   from FenceDevice import FenceDevice
   namechange = False
+
   try:
     agent_type = form['fence_type']
   except KeyError, e:
@@ -1309,7 +1310,7 @@
     return (FD_VAL_FAIL, "No device name in form submission")
 
   if fencedev_name == "":
-    return (1, "A unique name is required for every fence device")
+    return (1, "No device name in form submission")
 
   try:
     orig_name = form['orig_name']
@@ -1319,10 +1320,12 @@
   if orig_name != fencedev_name:
     namechange = True
 
-  fencedevs = model.getFenceDevices()
-  for fd in fencedevs:
-    if fd.getName().strip() == fencedev_name:
-      return (FD_VAL_FAIL, FD_PROVIDE_NAME)
+    fencedevs = model.getFenceDevices()
+    for fd in fencedevs:
+      if fd.getName().strip() == fencedev_name:
+        return (FD_VAL_FAIL, FD_PROVIDE_NAME)
+  else:
+    fencedevs = model.getFenceDevices()
 
   #Now we know name is unique...find device now
   fencedev = None
@@ -1336,7 +1339,7 @@
 
   if agent_type == "fence_apc":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1344,7 +1347,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1359,11 +1362,11 @@
 
   elif agent_type == "fence_wti":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1377,7 +1380,7 @@
 
   elif agent_type == "fence_brocade":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1385,7 +1388,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1400,11 +1403,11 @@
 
   elif agent_type == "fence_vixel":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1419,7 +1422,7 @@
 
   elif agent_type == "fence_mcdata":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1427,7 +1430,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1470,7 +1473,7 @@
 
   elif agent_type == "fence_sanbox2":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1478,7 +1481,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1493,7 +1496,7 @@
 
   elif agent_type == "fence_bladecenter":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1501,7 +1504,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
@@ -1516,7 +1519,7 @@
 
   elif agent_type == "fence_bullpap":
     try:
-      ip = form['ip_addr']
+      ip = form['ipaddr']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_IP)
     try:
@@ -1524,7 +1527,7 @@
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_LOGIN)
     try:
-      pwd = form['password']
+      pwd = form['passwd']
     except KeyError, e:
       return (FD_VAL_FAIL, FD_PROVIDE_PASSWD)
 
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/10 23:49:18	1.120.2.18
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/15 18:21:50	1.120.2.19
@@ -1979,7 +1979,7 @@
 	31: validateResourceAdd,
 	33: validateResourceAdd,
 	51: validateFenceAdd,
-	50: validateFenceEdit,
+	54: validateFenceEdit,
 	55: validateDaemonProperties,
 	57: deleteFenceDevice,
 	58: validateNodeFenceConfig
@@ -4066,12 +4066,13 @@
     infohash['reboot_url'] = baseurl + "?pagetype=" +NODE_PROCESS + "&task=" + NODE_REBOOT + "&nodename=" + nodename + "&clustername=" + clustername
     infohash['fence_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_FENCE + "&nodename=" + nodename + "&clustername=" + clustername
     infohash['delete_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_DELETE + "&nodename=" + nodename + "&clustername=" + clustername
-
-  if nodestate == NODE_INACTIVE:
+  elif nodestate == NODE_INACTIVE:
     infohash['jl_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_JOIN_CLUSTER + "&nodename=" + nodename + "&clustername=" + clustername
     infohash['reboot_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_REBOOT + "&nodename=" + nodename + "&clustername=" + clustername
     infohash['fence_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_FENCE + "&nodename=" + nodename + "&clustername=" + clustername
     infohash['delete_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_DELETE + "&nodename=" + nodename + "&clustername=" + clustername
+  else:
+    infohash['fence_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_FENCE + "&nodename=" + nodename + "&clustername=" + clustername
 
   #figure out current services running on this node
   svc_dict_list = list()
@@ -4196,13 +4197,13 @@
       map['reboot_url'] = baseurl + "?pagetype=" +NODE_PROCESS + "&task=" + NODE_REBOOT + "&nodename=" + name + "&clustername=" + clustername
       map['fence_it_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_FENCE + "&nodename=" + name + "&clustername=" + clustername
       map['delete_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_DELETE + "&nodename=" + name + "&clustername=" + clustername
-
-    if map['status'] == NODE_INACTIVE:
+    elif map['status'] == NODE_INACTIVE:
       map['jl_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_JOIN_CLUSTER + "&nodename=" + name + "&clustername=" + clustername
       map['reboot_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_REBOOT + "&nodename=" + name + "&clustername=" + clustername
       map['fence_it_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_FENCE + "&nodename=" + name + "&clustername=" + clustername
       map['delete_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_DELETE + "&nodename=" + name + "&clustername=" + clustername
-
+    else:
+      map['fence_it_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_FENCE + "&nodename=" + name + "&clustername=" + clustername
 
     #figure out current services running on this node
     svc_dict_list = list()
--- conga/luci/site/luci/Extensions/conga_constants.py	2007/01/10 22:53:56	1.19.2.6
+++ conga/luci/site/luci/Extensions/conga_constants.py	2007/01/15 18:21:50	1.19.2.7
@@ -130,7 +130,7 @@
 
 POSSIBLE_REBOOT_MESSAGE = "This node is not currently responding and is probably rebooting as planned. This state should persist for 5 minutes or so..."
 
-REDIRECT_MSG = " You will be redirected in 5 seconds. Please fasten your safety restraints."
+REDIRECT_MSG = " You will be redirected in 5 seconds."
 
 
 # Homebase-specific constants




More information about the Cluster-devel mailing list