diff options
author | shnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-07-18 11:07:01 +0000 |
---|---|---|
committer | shnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-07-18 11:07:01 +0000 |
commit | a08525cd91812ade75eccc92b677695c739cc991 (patch) | |
tree | f2f18cfdac4ce3d472d61ae7f7a7f02b830926e1 | |
parent | afdd1f418fd0fef7c0211fdf3f19e279feeb265d (diff) | |
download | sos-a08525cd91812ade75eccc92b677695c739cc991.tar.gz |
* 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
-rw-r--r-- | src/lib/sos/plugins/cluster.py | 19 |
1 files changed, 18 insertions, 1 deletions
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": |