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

rmccabe at sourceware.org rmccabe at sourceware.org
Mon Dec 11 21:51:14 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-12-11 21:51:14

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

Log message:
	fixes for bz219156

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.126&r2=1.127
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.178&r2=1.179

--- conga/luci/cluster/form-macros	2006/12/08 20:47:37	1.126
+++ conga/luci/cluster/form-macros	2006/12/11 21:51:13	1.127
@@ -2318,14 +2318,20 @@
 				<form method="post" onSubmit="return dropdown(this.gourl)">
 				<select name="gourl">
 					<option value="">Choose a Task...</option>
-					<option tal:attributes="value nodeinfo/jl_url">
+					<option tal:attributes="value nodeinfo/jl_url"
+						tal:condition="python: not 'ricci_error' in nodeinfo">
 						Have node <span tal:replace="python: nodeinfo['nodestate'] == '0' and 'leave' or 'join'" /> cluster
 					</option>
 					<option value="">----------</option>
 					<option tal:attributes="value nodeinfo/fence_url">Fence this node</option>
-					<option value="" tal:attributes="value nodeinfo/reboot_url">Reboot this node</option>
+					<option value="" tal:attributes="value nodeinfo/reboot_url"
+						tal:condition="python: not 'ricci_error' in nodeinfo">
+						Reboot this node
+					</option>
 					<option value="">----------</option>
-					<option tal:attributes="value nodeinfo/delete_url">Delete this node</option>
+					<option tal:attributes="value nodeinfo/delete_url"
+						tal:condition="python: not 'ricci_error' in nodeinfo">
+						Delete this node</option>
 				</select>
 				<input type="submit" value="Go"/>
 				</form>
@@ -2342,7 +2348,7 @@
 		</tr>
 
 		<tr class="cluster node info_bottom"
-			tal:condition="python: nodeinfo['nodestate'] == '0' or nodeinfo['nodestate'] == '1'">
+			tal:condition="python: (nodeinfo['nodestate'] == '0' or nodeinfo['nodestate'] == '1') and not 'ricci_error' in nodeinfo">
 			<td class="cluster node node_log" colspan="2">
 				<a class="cluster node"
 					tal:attributes="href nodeinfo/logurl" onClick="return popup_log(this, 'notes')">
@@ -2352,6 +2358,7 @@
 		</tr>
 	</table>
 
+	<tal:block tal:condition="python: not 'ricci_error' in nodeinfo">
 	<hr/>
 
 	<tal:block
@@ -2445,13 +2452,6 @@
 		global fenceinfo python: here.getFenceInfo(modelb, request);
 		global fencedevinfo python: here.getFencesInfo(modelb, request)" />
 
-	<div>
-		fenceinfo:
-		<span tal:replace="fenceinfo" /><br/>
-		fencedevinfo:
-		<span tal:replace="fencedevinfo" />
-	</div>
-
 	<div class="invisible" id="shared_fence_devices">
 		<tal:block tal:repeat="cur_fencedev fencedevinfo/fencedevs">
 			<tal:block metal:use-macro="here/form-macros/macros/shared-fence-device-list" />
@@ -2557,6 +2557,13 @@
 		</tr>
 		</tbody>
 	</table>
+	</tal:block>
+	<tal:block tal:condition="python: 'ricci_error' in nodeinfo">
+		<hr/>
+		<strong class="errmsgs">
+			The ricci agent for this node is unresponsive. Node-specific information is not available at this time.
+		</strong>
+	</tal:block>
 </div>
 
 <div metal:define-macro="nodes-form">
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/12/08 23:02:49	1.178
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/12/11 21:51:14	1.179
@@ -3231,6 +3231,7 @@
         raise Exception, 'rc is none'
     except Exception, e:
       rc = None
+      infohash['ricci_error'] = True
       luci_log.info('Error connecting to %s: %s' \
           % (nodename_resolved, str(e)))
 
@@ -3242,6 +3243,8 @@
       dlist.append("rgmanager")
       states = getDaemonStates(rc, dlist)
       infohash['d_states'] = states
+  else:
+    infohash['ricci_error'] = True
 
   infohash['logurl'] = '/luci/logs/?nodename=' + nodename_resolved + '&clustername=' + clustername
   return infohash
@@ -3333,7 +3336,12 @@
 
     map['currentservices'] = svc_dict_list
     #next is faildoms
-    fdoms = model.getFailoverDomainsForNode(name)
+
+    if model:
+      fdoms = model.getFailoverDomainsForNode(name)
+    else:
+      map['ricci_error'] = True
+      fdoms = list()
     fdom_dict_list = list()
     for fdom in fdoms:
       fdom_dict = {}




More information about the Cluster-devel mailing list