From a08525cd91812ade75eccc92b677695c739cc991 Mon Sep 17 00:00:00 2001 From: shnavid Date: Wed, 18 Jul 2007 11:07:01 +0000 Subject: * added checkenabled() to cluster plugin (only enable if RHCS/GFS related data is present) git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@221 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/lib/sos/plugins/cluster.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/lib/sos/plugins/cluster.py b/src/lib/sos/plugins/cluster.py index 5ace5620..595d940a 100644 --- a/src/lib/sos/plugins/cluster.py +++ b/src/lib/sos/plugins/cluster.py @@ -13,11 +13,28 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import sos.plugintools -import commands +import commands, os class cluster(sos.plugintools.PluginBase): """cluster suite and GFS related information """ + def checkenabled(self): + # enable if any related package is installed + for pkg in [ "ccs", "cman", "cman-kernel", "magma", "magma-plugins", + "rgmanager", "fence", "dlm", "dlm-kernel", "gulm", + "GFS", "GFS-kernel", "lvm2-cluster" ]: + if self.cInfo["policy"].pkgByName(pkg) != None: + return True + + # enable if any related file is present + for fname in [ "/etc/cluster/cluster.conf" ]: + try: os.stat(fname) + except:pass + else: return True + + # no data related to RHCS/GFS exists + return False + def diagnose(self): rhelver = self.cInfo["policy"].pkgDictByName("fedora-release")[0] if rhelver == "6": -- cgit