[Cluster-devel] conga ./clustermon.spec.in.in luci/cluster/clu ...

rmccabe at sourceware.org rmccabe at sourceware.org
Mon Aug 4 21:49:33 UTC 2008


CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2008-08-04 21:49:31

Modified files:
	.              : clustermon.spec.in.in 
	luci/cluster   : cluster_svc-macros form-macros 
	luci/site/luci/Extensions: LuciClusterInfo.py LuciDB.py 
	luci/site/luci/Extensions/ClusterModel: ModelBuilder.py 

Log message:
	Fail gracefully and warn the user when a cluster.conf has unresolved references

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18.2.41&r2=1.18.2.42
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/cluster_svc-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.5&r2=1.3.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.90.2.36&r2=1.90.2.37
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.11&r2=1.1.4.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciDB.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/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.8&r2=1.1.4.9

--- conga/clustermon.spec.in.in	2008/07/29 07:23:00	1.18.2.41
+++ conga/clustermon.spec.in.in	2008/08/04 21:49:29	1.18.2.42
@@ -193,9 +193,11 @@
 
 
 %changelog
+* Wed Jul 30 2008 Ryan McCabe <rmccabe at redhat.com> 0.12.1-2
+- Fix bz453600 (cluster-snmp deadlocks snmpd)
+
 * Thu Apr 10 2008 Ryan McCabe <rmccabe at redhat.com> 0.12.1-1
 - Fix bz441947 (cluster-snmp dlopen failure)
-- Fix bz453600 (cluster-snmp deadlocks snmpd)
 
 * Thu Mar 27 2008 Ryan McCabe <rmccabe at redhat.com> 0.12.0-7
 - Fix bz439186
--- conga/luci/cluster/cluster_svc-macros	2008/07/23 19:55:41	1.3.2.5
+++ conga/luci/cluster/cluster_svc-macros	2008/08/04 21:49:30	1.3.2.6
@@ -707,7 +707,8 @@
 		<tal:block metal:use-macro="here/resource-form-macros/macros/service-compose-macro" />
 	</div>
 
-	<div class="service_comp_list" tal:attributes="id sinfo/root_uuid">
+	<div class="service_comp_list"
+		tal:attributes="id sinfo/root_uuid|string:toplevel">
 	<div tal:repeat="res resource_list"
 		tal:attributes="
 			class python: 'service_comp rc_indent' + str(res['indent_ctr']);
@@ -746,7 +747,7 @@
 			tal:attributes="
 				value request/pagetype | request/form/pagetype | nothing" />
 		<input type="hidden" name="clustername"
-			tal:attributes="value clusterinfo/clustername" />
+			tal:attributes="value clusterinfo/clustername | nothing" />
 		<input type="button" value="Add a resource to this service"
 			onclick="add_child_resource(this.form);" />
 		<input type="button" value="Save changes"
--- conga/luci/cluster/form-macros	2008/06/13 18:37:46	1.90.2.36
+++ conga/luci/cluster/form-macros	2008/08/04 21:49:30	1.90.2.37
@@ -942,6 +942,16 @@
 		global status python: here.getClusterStatus(request, ricci_agent);
 		global nds python: here.getNodesInfo(modelb, status, request)" />
 
+	<div tal:condition="python:len(nds) > 0 and nds[0].get('has_errors')" class="errmsgs">
+        <div tal:condition="python:nds[0].get('errmsgs')">
+			The cluster.conf for this cluster appears to have errors: <span tal:replace="python:nds[0].get('errmsgs')" />
+		</div>
+        <div tal:condition="python:not nds[0].get('errmsgs')">
+			The cluster.conf for this cluster appears to have errors
+		</div>
+	</div>
+	<div> </div>
+
 	<div tal:repeat="nd nds">
 		<tal:block
 			tal:define="global node_class python: 'cluster node ' + ((nd['status'] == '0' and 'node_active' or (nd['status'] == '1' and 'node_inactive' or 'node_unknown')))" />
--- conga/luci/site/luci/Extensions/LuciClusterInfo.py	2008/06/13 18:37:47	1.1.4.11
+++ conga/luci/site/luci/Extensions/LuciClusterInfo.py	2008/08/04 21:49:30	1.1.4.12
@@ -82,6 +82,9 @@
 		vals['votes'] = '[unknown]'
 		vals['quorate'] = '[unknown]'
 		vals['minQuorum'] = '[unknown]'
+		if model.has_erors():
+			vals['errors'] = True
+			vals['errmsgs'] = model.get_errmsgs()
 		results.append(vals)
 	except Exception, e:
 		if LUCI_DEBUG_MODE is True:
@@ -738,6 +741,9 @@
 			hlist.append(hmap)
 	clumap['hlist'] = hlist
 
+	if model.has_errors():
+		clumap['has_errors'] = True
+		clumap['errmsgs'] = model.get_errmsgs()
 	return clumap
 
 def getClustersInfo(self, status, req):
@@ -1081,6 +1087,10 @@
 			fdom_dict_list.append(fdom_dict)
 
 		nl_map['fdoms'] = fdom_dict_list
+
+		if model.has_errors():
+			nl_map['has_errors'] = True
+			nl_map['errmsgs'] = model.get_errmsgs()
 		resultlist.append(nl_map)
 
 	return resultlist
--- conga/luci/site/luci/Extensions/LuciDB.py	2008/03/12 15:13:12	1.1.4.9
+++ conga/luci/site/luci/Extensions/LuciDB.py	2008/08/04 21:49:30	1.1.4.10
@@ -836,6 +836,9 @@
 	for node in nodes:
 		hostname = node[0]
 
+		if hostname[-6:] == '__flag':
+			continue
+
 		if exclude_names is not None and hostname in exclude_names:
 			if LUCI_DEBUG_MODE is True:
 				luci_log.debug_verbose('GRA5: %s is in the excluded names list, excluding it' % hostname)
--- conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py	2008/03/12 15:13:13	1.1.4.8
+++ conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py	2008/08/04 21:49:31	1.1.4.9
@@ -127,6 +127,8 @@
     if domm is None:
       raise Exception, 'No cluster configuration'
 
+    self.errors = False
+    self.errmsg = None
     self.lock_type = DLM_TYPE
     self.mcast_address = mcast_addr
     self.mcast_interface = None
@@ -164,6 +166,12 @@
     self.check_for_multicast()
     self.check_for_nodeids()
 
+  def has_errors(self):
+    return self.errors
+
+  def get_errmsgs(self):
+    return self.errmsg
+
   def getClusterOS(self):
     return self.cluster_os
 
@@ -339,12 +347,24 @@
     for fd in self.getFenceDevices():
       agent = fd.getAgentType()
       if agent is not None:
-        agent_hash[fd.getName()] = agent
+        try:
+          agent_hash[fd.getName()] = agent
+        except KeyError, e:
+          self.errors = True
+          self.errmsg = 'Unknown fence device: %s' % fd.getName()
+        except Exception, e1:
+          self.errors = True
 
     for node in self.getNodes():
       for level in node.getFenceLevels():
         for child in level.getChildren():
-          child.setAgentType(agent_hash[child.getName()])
+          try:
+            child.setAgentType(agent_hash[child.getName()])
+          except KeyError, e:
+            self.errors = True
+            self.errmsg = 'Unknown fence device: %s' % child.getName()
+          except Exception, e1:
+            self.errors = True
     
   ##This method builds RefObject containers for appropriate
   ##entities after the object tree is built.




More information about the Cluster-devel mailing list