From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 4 Aug 2008 21:49:33 -0000 Subject: [Cluster-devel] conga ./clustermon.spec.in.in luci/cluster/clu ... Message-ID: <20080804214933.28145.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 0.12.1-2 +- Fix bz453600 (cluster-snmp deadlocks snmpd) + * Thu Apr 10 2008 Ryan McCabe 0.12.1-1 - Fix bz441947 (cluster-snmp dlopen failure) -- Fix bz453600 (cluster-snmp deadlocks snmpd) * Thu Mar 27 2008 Ryan McCabe 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:attributes="value clusterinfo/clustername | nothing" /> +
+
+ The cluster.conf for this cluster appears to have errors: +
+
+ The cluster.conf for this cluster appears to have errors +
+
+
 
+
--- 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.