diff options
author | Adam Stokes <adam.stokes@canonical.com> | 2012-02-27 00:27:52 +0000 |
---|---|---|
committer | Jesse Jaggars <jjaggars@redhat.com> | 2012-03-02 09:27:25 -0600 |
commit | 4d488a578760500c4a1983702b56ec59e2fe1843 (patch) | |
tree | 59a38900b72aaaaecdc0937d71f0cf90df2b9df8 | |
parent | 928f48f80a6b3817d4779772c53e64dfa5517eb2 (diff) | |
download | sos-4d488a578760500c4a1983702b56ec59e2fe1843.tar.gz |
sos/plugins: Remove the use of inheriting checkenabled to
allow for a more flexible way of checking plugin enablement
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
43 files changed, 130 insertions, 150 deletions
diff --git a/sos/plugins/amd.py b/sos/plugins/amd.py index 2a6776c6..a682b5ec 100644 --- a/sos/plugins/amd.py +++ b/sos/plugins/amd.py @@ -15,14 +15,12 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin -from os.path import exists class amd(Plugin, RedHatPlugin): """Amd automounter information """ - - def checkenabled(self): - return self.isInstalled("am-utils") or exists("/etc/rc.d/init.d/amd") + files = ('/etc/rc.d/init.d/amd') + packages = ('am-utils') def setup(self): self.addCopySpecs("/etc/amd.*") diff --git a/sos/plugins/anaconda.py b/sos/plugins/anaconda.py index de7787bd..6fef6ec3 100644 --- a/sos/plugins/anaconda.py +++ b/sos/plugins/anaconda.py @@ -13,13 +13,12 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin -from os.path import exists class anaconda(Plugin, RedHatPlugin): """Anaconda / Installation information """ - def checkenabled(self): - return exists("/var/log/anaconda.log") + + files = ('/var/log/anaconda.log') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/autofs.py b/sos/plugins/autofs.py index a295b23e..fcf0eaa8 100644 --- a/sos/plugins/autofs.py +++ b/sos/plugins/autofs.py @@ -20,10 +20,9 @@ import os, re class autofs(Plugin, RedHatPlugin): """autofs server-related information """ - def checkenabled(self): - self.packages = [ "autofs" ] - self.files = [ "/etc/sysconfig/autofs" ] - return Plugin.checkenabled(self) + + files = ('/etc/sysconfig/autofs') + packages = ('autofs') def checkdebug(self): """ testing if autofs debug has been enabled anywhere diff --git a/sos/plugins/cobbler.py b/sos/plugins/cobbler.py index d17b8020..c4fc1a74 100644 --- a/sos/plugins/cobbler.py +++ b/sos/plugins/cobbler.py @@ -17,8 +17,8 @@ from sos.plugins import Plugin, RedHatPlugin class cobbler(Plugin, RedHatPlugin): """cobbler related information """ - def checkenabled(self): - return self.isInstalled("cobbler") + + packages = ('cobbler') def setup(self): self.addCopySpec("/etc/cobbler") diff --git a/sos/plugins/corosync.py b/sos/plugins/corosync.py index 862659fe..500e4176 100644 --- a/sos/plugins/corosync.py +++ b/sos/plugins/corosync.py @@ -18,10 +18,8 @@ class corosync(Plugin, RedHatPlugin): """ corosync information """ - def checkenabled(self): - self.files = ['/usr/sbin/corosync'] - self.packages = ['corosync'] - return Plugin.checkenabled(self) + files = ('/usr/bin/corosync') + packages = ('corosync') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/dhcp.py b/sos/plugins/dhcp.py index ee6719a6..d3e7690f 100644 --- a/sos/plugins/dhcp.py +++ b/sos/plugins/dhcp.py @@ -17,10 +17,9 @@ from sos.plugins import Plugin, RedHatPlugin class dhcp(Plugin, RedHatPlugin): """DHCP related information """ - def checkenabled(self): - self.files = ['/etc/rc.d/init.d/dhcpd'] - self.packages = ['dhcp'] - return Plugin.checkenabled(self) + + files = ('/etc/rc.d/init.d/dhcpd') + packages = ('dhcp') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/ds.py b/sos/plugins/ds.py index 107274c8..df5df197 100644 --- a/sos/plugins/ds.py +++ b/sos/plugins/ds.py @@ -21,6 +21,9 @@ class ds(Plugin, RedHatPlugin): """Directory Server information """ + files = ('/etc/dirsrv', '/opt/redhat-ds') + packages = ('redhat-ds-base', 'redhat-ds-7') + def check_version(self): if self.isInstalled("redhat-ds-base") or \ os.path.exists("/etc/dirsrv"): @@ -30,15 +33,6 @@ class ds(Plugin, RedHatPlugin): return "ds7" return False - def checkenabled(self): - if self.isInstalled("redhat-ds-base") or \ - os.path.exists("/etc/dirsrv"): - return True - elif self.isInstalled("redhat-ds-7") or \ - os.path.exists("/opt/redhat-ds"): - return True - return False - def setup(self): if not self.check_version(): self.addAlert("Directory Server not found.") diff --git a/sos/plugins/ftp.py b/sos/plugins/ftp.py index 3a7d2647..ef8b674c 100644 --- a/sos/plugins/ftp.py +++ b/sos/plugins/ftp.py @@ -19,8 +19,8 @@ class ftp(Plugin, RedHatPlugin): """FTP server related information """ - def checkenabled(self): - return self.isInstalled("vsftpd") or exists("/etc/vsftpd") + files = ('/etc/vsftpd') + packages = ('vsftpd') def setup(self): self.addCopySpec("/etc/ftp*") diff --git a/sos/plugins/general.py b/sos/plugins/general.py index 434554ee..1c320e43 100644 --- a/sos/plugins/general.py +++ b/sos/plugins/general.py @@ -63,13 +63,13 @@ class general(Plugin, RedHatPlugin): def postproc(self): self.doRegexSub("/etc/sysconfig/rhn/up2date", r"(\s*proxyPassword\s*=\s*)\S+", r"\1***") - + class generalDebian(Plugin, DebianPlugin, UbuntuPlugin): """Basic system information for Debian based distributions""" @classmethod def name(self): return "general" - + def setup(self): self.addCopySpecs([ "/etc/debian_version", diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py index 24199512..174baacf 100644 --- a/sos/plugins/gluster.py +++ b/sos/plugins/gluster.py @@ -18,8 +18,7 @@ from sos.plugins import Plugin, RedHatPlugin class gluster(Plugin, RedHatPlugin): '''gluster related information''' - def checkenabled(self): - return os.path.exists("/etc/glusterd") + files = ('/etc/glusterd') def setup(self): self.addForbiddenPath("/etc/glusterd/geo-replication/secret.pem") diff --git a/sos/plugins/ipa.py b/sos/plugins/ipa.py index 824526ad..8ffc245a 100644 --- a/sos/plugins/ipa.py +++ b/sos/plugins/ipa.py @@ -23,8 +23,8 @@ class ipa(Plugin, RedHatPlugin): # ntp and dirserver stuff are covered in existing sos plugins, so we really only # need to get kerberos and ipa specific addons. - def checkenabled(self): - return self.isInstalled("ipa-server") or exists("/etc/ipa") + files = ('/etc/ipa') + packages = ('ipa-server') def setup(self): self.addCopySpec("/etc/dirsrv/ds.keytab") diff --git a/sos/plugins/ipsec.py b/sos/plugins/ipsec.py index 8fc09628..b9526e9b 100644 --- a/sos/plugins/ipsec.py +++ b/sos/plugins/ipsec.py @@ -20,8 +20,9 @@ from os.path import exists class ipsec(Plugin, RedHatPlugin): """ipsec related information """ - def checkenabled(self): - return self.isInstalled("ipsec-tools") or exists("/etc/racoon/racoon.conf") + + files = ('/etc/racoon/racoon.conf') + packages = ('ipsec-tools') def setup(self): self.addCopySpec("/etc/racoon") diff --git a/sos/plugins/iscsitarget.py b/sos/plugins/iscsitarget.py index b12e7712..841d81f2 100644 --- a/sos/plugins/iscsitarget.py +++ b/sos/plugins/iscsitarget.py @@ -20,9 +20,7 @@ class iscsitarget(Plugin, RedHatPlugin): """iscsi-target related information """ - def checkenabled(self): - self.packages = [ "scsi-target-utils" ] - return Plugin.checkenabled(self) + packages = ('scsi-target-utils') def setup(self): self.addCopySpec("/etc/tgt/targets.conf") diff --git a/sos/plugins/kdump.py b/sos/plugins/kdump.py index 3a138693..e624645e 100644 --- a/sos/plugins/kdump.py +++ b/sos/plugins/kdump.py @@ -18,8 +18,9 @@ from os.path import exists class kdump(Plugin, RedHatPlugin): """Kdump related information """ - def checkenabled(self): - return self.isInstalled("kexec-tools") or exists("/etc/kdump.conf") + + files = ('/etc/kdump.conf') + packages = ('kexec-tools') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/ldap.py b/sos/plugins/ldap.py index b331c26e..fbf3af80 100644 --- a/sos/plugins/ldap.py +++ b/sos/plugins/ldap.py @@ -18,10 +18,9 @@ import os class ldap(Plugin, RedHatPlugin): """LDAP related information """ - def checkenabled(self): - self.packages = [ "openldap" ] - self.files = [ "/etc/openldap/ldap.conf" ] - return Plugin.checkenabled(self) + + files = ('/etc/openldap/ldap.conf') + packages = ('openldap') def get_ldap_opts(self): # capture /etc/openldap/ldap.conf options in dict diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py index 5c7049db..019839fa 100644 --- a/sos/plugins/mysql.py +++ b/sos/plugins/mysql.py @@ -19,10 +19,8 @@ class mysql(Plugin, RedHatPlugin): """MySQL related information """ - def checkenabled(self): - return self.isInstalled("mysql-server") or \ - exists("/etc/my.cnf") or \ - self.isInstalled("mysql") + files = ('/etc/my.cnf') + packages = ('mysql-server', 'mysql') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/named.py b/sos/plugins/named.py index 8e6af6dd..3656d5b7 100644 --- a/sos/plugins/named.py +++ b/sos/plugins/named.py @@ -19,11 +19,9 @@ from os.path import normpath, join, exists class named(Plugin, RedHatPlugin): """named related information """ - def checkenabled(self): - self.files = [ "/etc/named.conf", - "/etc/sysconfig/named" ] - self.packages = [ "bind" ] - return Plugin.checkenabled(self) + + files = ('/etc/named.conf', '/etc/sysconfig/named') + packages = ('bind') def getDnsDir(self, configFile): """ grab directory path from named{conf,boot} diff --git a/sos/plugins/netdump.py b/sos/plugins/netdump.py index 815c5955..1fa2cbb1 100644 --- a/sos/plugins/netdump.py +++ b/sos/plugins/netdump.py @@ -18,8 +18,9 @@ from os.path import exists class netdump(Plugin, RedHatPlugin): """Netdump Configuration Information """ - def checkenabled(self): - return self.isInstalled("netdump") or exists("/etc/sysconfig/netdump*") + + files = ('/etc/sysconfig/netdump') + packages = ('netdump') def setup(self): self.addCopySpec("/etc/sysconfig/netdump") diff --git a/sos/plugins/nis.py b/sos/plugins/nis.py index bd45e3d5..772052f6 100644 --- a/sos/plugins/nis.py +++ b/sos/plugins/nis.py @@ -1,29 +1,29 @@ -## nis.py
-## A plugin to gather all the NIS information
-
-### This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-from sos.plugins import Plugin, RedHatPlugin
-import os
-
-class nis(Plugin, RedHatPlugin):
- """NIS related information
- """
- def checkenabled(self):
- return os.path.exists("/var/yp")
-
- def setup(self):
- self.addCopySpec("/etc/yp*.conf")
- self.addCopySpec("/var/yp/*")
+## nis.py +## A plugin to gather all the NIS information + +### This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. + +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin +import os + +class nis(Plugin, RedHatPlugin): + """NIS related information + """ + + files = ('/var/yp') + + def setup(self): + self.addCopySpec("/etc/yp*.conf") + self.addCopySpec("/var/yp/*") diff --git a/sos/plugins/nscd.py b/sos/plugins/nscd.py index 6fcc3ad2..23f5c439 100644 --- a/sos/plugins/nscd.py +++ b/sos/plugins/nscd.py @@ -24,8 +24,8 @@ class nscd(Plugin, RedHatPlugin): optionList = [("nscdlogsize", "max size (MiB) to collect per nscd log file", "", 50)] - def checkenabled(self): - return self.isInstalled("nscd") or exists("/etc/nscd.conf") + files = ('/etc/nscd.conf') + packages = ('nscd') def setup(self): self.addCopySpec("/etc/nscd.conf") diff --git a/sos/plugins/oddjob.py b/sos/plugins/oddjob.py index 19f666a7..8e0d0377 100644 --- a/sos/plugins/oddjob.py +++ b/sos/plugins/oddjob.py @@ -15,13 +15,13 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin -from os.path import exists class oddjob(Plugin, RedHatPlugin): """oddjob related information """ - def checkenabled(self): - return self.isInstalled("oddjob") or exists("/etc/oddjobd.conf") + + files = ('/etc/oddjobd.conf') + packages = ('oddjob') def setup(self): self.addCopySpec("/etc/oddjobd.conf") diff --git a/sos/plugins/openssl.py b/sos/plugins/openssl.py index 35911593..49098794 100644 --- a/sos/plugins/openssl.py +++ b/sos/plugins/openssl.py @@ -15,14 +15,13 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin -from os.path import exists class openssl(Plugin, RedHatPlugin): """openssl related information """ - def checkenabled(self): - return self.isInstalled("openssl") or exists("/etc/pki/tls/openssl.cnf") + files = ('/etc/pki/tls/openssl.cnf') + packages = ('openssl') def setup(self): self.addCopySpec("/etc/pki/tls/openssl.cnf") diff --git a/sos/plugins/openswan.py b/sos/plugins/openswan.py index bd9de349..d6dc1db0 100644 --- a/sos/plugins/openswan.py +++ b/sos/plugins/openswan.py @@ -20,8 +20,9 @@ from os.path import exists class openswan(Plugin, RedHatPlugin): """ipsec related information """ - def checkenabled(self): - return self.isInstalled("openswan") or exists("/etc/ipsec.conf") + + files = ('/etc/ipsec.conf') + packages = ('openswan') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/postfix.py b/sos/plugins/postfix.py index 1c604898..b2eda39f 100644 --- a/sos/plugins/postfix.py +++ b/sos/plugins/postfix.py @@ -18,8 +18,9 @@ from os.path import exists class postfix(Plugin, RedHatPlugin): """mail server related information """ - def checkenabled(self): - return self.isInstalled("postfix") or exists("/etc/rc.d/init.d/postfix") + + files = ('/etc/rc.d/init.d/postfix') + packages = ('postfix') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/ppp.py b/sos/plugins/ppp.py index 98c68a84..89c33956 100644 --- a/sos/plugins/ppp.py +++ b/sos/plugins/ppp.py @@ -20,8 +20,9 @@ from os.path import exists class ppp(Plugin, RedHatPlugin): """ppp, wvdial and rp-pppoe related information """ - def checkenabled(self): - return self.isInstalled("ppp") or exists("/etc/wvdial.conf") + + files = ('/etc/wvdial.conf') + packages = ('ppp') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/pxe.py b/sos/plugins/pxe.py index 3a00d478..f55b9810 100644 --- a/sos/plugins/pxe.py +++ b/sos/plugins/pxe.py @@ -20,9 +20,8 @@ class pxe(Plugin, RedHatPlugin): """ optionList = [("tftpboot", 'gathers content in /tftpboot', 'slow', False)] - - def checkenabled(self): - return self.isInstalled("system-config-netboot-cmd") or exists("/usr/sbin/pxeos") + files = ('/usr/sbin/pxeos') + packages = ('system-config-netboot-cmd') def setup(self): self.collectExtOutput("/usr/sbin/pxeos -l") diff --git a/sos/plugins/qpidd.py b/sos/plugins/qpidd.py index 564da7d2..6561b564 100644 --- a/sos/plugins/qpidd.py +++ b/sos/plugins/qpidd.py @@ -17,9 +17,8 @@ from sos.plugins import Plugin, RedHatPlugin class qpidd(Plugin, RedHatPlugin): """Messaging related information """ - def checkenabled(self): - """ checks if mrg enabled """ - return self.isInstalled("qpidd") and self.isInstalled("python-qpid") + + packages = ('qpidd', 'python-qpid') def setup(self): """ performs data collection for mrg """ diff --git a/sos/plugins/quagga.py b/sos/plugins/quagga.py index 013d41ab..00595928 100644 --- a/sos/plugins/quagga.py +++ b/sos/plugins/quagga.py @@ -21,8 +21,8 @@ class quagga(Plugin, RedHatPlugin): """quagga related information """ - def checkenabled(self): - return self.isInstalled("quagga") or exists("/etc/quagga/zebra.conf") + files = ('/etc/quagga/zebra.conf') + packages = ('quagga') def setup(self): self.addCopySpec("/etc/quagga/") diff --git a/sos/plugins/radius.py b/sos/plugins/radius.py index f9621aeb..b68e45ae 100644 --- a/sos/plugins/radius.py +++ b/sos/plugins/radius.py @@ -20,8 +20,9 @@ from os.path import exists class radius(Plugin, RedHatPlugin): """radius related information """ - def checkenabled(self): - return self.isInstalled("freeradius") or exists("/etc/raddb") + + files = ('/etc/raddb') + packages = ('freeradius') def setup(self): self.addCopySpecs(["/etc/raddb", "/etc/pam.d/radiusd", "/var/log/radius"]) diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py index 50e6077b..f6c283d2 100644 --- a/sos/plugins/sar.py +++ b/sos/plugins/sar.py @@ -19,6 +19,9 @@ from os.path import exists class sar(Plugin, RedHatPlugin): """Generate the sar file from /var/log/sa/saXX files """ + + files = ('/var/log/sa', '/usr/bin/sar') + def setup(self): path="/var/log/sa" dirList=listdir(path) @@ -30,5 +33,3 @@ class sar(Plugin, RedHatPlugin): sar_command = "/bin/sh -c \"LANG=C /usr/bin/sar -A -f /var/log/sa/" + fname + "\"" self.collectOutputNow(sar_command, sar_filename, root_symlink=sar_filename) - def checkenabled(self): - return exists("/var/log/sa") and exists("/usr/bin/sar") diff --git a/sos/plugins/sendmail.py b/sos/plugins/sendmail.py index d7672da4..cf03d024 100644 --- a/sos/plugins/sendmail.py +++ b/sos/plugins/sendmail.py @@ -20,8 +20,9 @@ from os.path import exists class sendmail(Plugin, RedHatPlugin): """sendmail information """ - def checkenabled(self): - return self.isInstalled("sendmail") or exists("/etc/rc.d/init.d/sendmail") + + files = ('/etc/rc.d/init.d/sendmail') + packages = ('sendmail') def setup(self): self.addCopySpecs(["/etc/mail/*", "/var/log/maillog"]) diff --git a/sos/plugins/smartcard.py b/sos/plugins/smartcard.py index 2f9ee3c2..0748909e 100644 --- a/sos/plugins/smartcard.py +++ b/sos/plugins/smartcard.py @@ -22,8 +22,8 @@ class smartcard(Plugin, RedHatPlugin): """Smart Card related information """ - def checkenabled(self): - return self.isInstalled("pam_pkcs11") or os.path.exists("/etc/pam_pkcs11/pam_pkcs11.conf") + files = ('/etc/pam_pkcs11/pam_pkcs11.conf') + packages = ('pam_pkcs11') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/snmp.py b/sos/plugins/snmp.py index 81536f57..a619cd83 100644 --- a/sos/plugins/snmp.py +++ b/sos/plugins/snmp.py @@ -20,8 +20,9 @@ from os.path import exists class snmp(Plugin, RedHatPlugin): """snmp related information """ - def checkenabled(self): - return self.isInstalled("net-snmp") or exists("/etc/snmp/snmpd.conf") + + files = ('/etc/snmp/snmpd.conf') + packages = ('net-snmp') def setup(self): self.addCopySpec("/etc/snmp") diff --git a/sos/plugins/squid.py b/sos/plugins/squid.py index b7f58371..575dc3e4 100644 --- a/sos/plugins/squid.py +++ b/sos/plugins/squid.py @@ -18,10 +18,9 @@ import os class squid(Plugin, RedHatPlugin): """squid related information """ - def checkenabled(self): - self.files = [ "/etc/squid/squid.conf" ] - self.packages = [ "squid" ] - return Plugin.checkenabled(self) + + files = ('/etc/squid/squid.conf') + packages = ('squid') def setup(self): self.addCopySpec("/etc/squid/squid.conf") diff --git a/sos/plugins/sssd.py b/sos/plugins/sssd.py index 641ae916..e1acc770 100644 --- a/sos/plugins/sssd.py +++ b/sos/plugins/sssd.py @@ -21,8 +21,7 @@ class sssd(Plugin, RedHatPlugin): """sssd-related Diagnostic Information """ - def checkenabled(self): - return self.isInstalled("sssd") + packages = ('sssd') def setup(self): self.addCopySpecs(["/etc/sssd", "/var/log/sssd/*"]) diff --git a/sos/plugins/systemtap.py b/sos/plugins/systemtap.py index 0f227a36..8b3a9de9 100644 --- a/sos/plugins/systemtap.py +++ b/sos/plugins/systemtap.py @@ -19,10 +19,9 @@ from sos.plugins import Plugin, RedHatPlugin class systemtap(Plugin, RedHatPlugin): """SystemTap information """ - def checkenabled(self): - self.files = [ "/usr/bin/stap" ] - self.packages = [ "systemtap", "systemtap-runtime" ] - return Plugin.checkenabled(self) + + files = ('/usr/bin/stap') + packages = ('systemtap', 'systemtap-runtime') def setup(self): self.collectExtOutput("/usr/bin/stap -V 2") diff --git a/sos/plugins/tftpserver.py b/sos/plugins/tftpserver.py index 5b563d84..d2babc71 100644 --- a/sos/plugins/tftpserver.py +++ b/sos/plugins/tftpserver.py @@ -20,8 +20,9 @@ from os.path import exists class tftpserver(Plugin, RedHatPlugin): """tftpserver related information """ - def checkenabled(self): - return self.isInstalled("tftp-server") or exists("/etc/xinetd.d/tftp") + + files = ('/etc/xinetd.d/tftp') + packages = ('tftp-server') def setup(self): self.collectExtOutput("/bin/ls -lanR /tftpboot") diff --git a/sos/plugins/tomcat.py b/sos/plugins/tomcat.py index 382e8531..216ed650 100644 --- a/sos/plugins/tomcat.py +++ b/sos/plugins/tomcat.py @@ -17,8 +17,8 @@ from sos.plugins import Plugin, RedHatPlugin class tomcat(Plugin, RedHatPlugin): """Tomcat related information """ - def checkenabled(self): - return self.isInstalled("tomcat5") + + packages = ('tomcat5') def setup(self): self.addCopySpecs(["/etc/tomcat5", "/var/log/tomcat5"]) diff --git a/sos/plugins/udhcp.py b/sos/plugins/udhcp.py index f884e796..8b4c39c8 100644 --- a/sos/plugins/udhcp.py +++ b/sos/plugins/udhcp.py @@ -18,10 +18,8 @@ from sos.plugins import Plugin, UbuntuPlugin class udhcp(Plugin, UbuntuPlugin): """DHCP related information """ - def checkenabled(self): - self.files = ['/etc/init.d/udhcpd'] - self.packages = ['udhcpd'] - return Plugin.checkenabled(self) + files = ('/etc/init.d/udhcpd') + packages = ('udhcpd') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/vmware.py b/sos/plugins/vmware.py index a833df2e..7282eca7 100644 --- a/sos/plugins/vmware.py +++ b/sos/plugins/vmware.py @@ -18,8 +18,8 @@ from os.path import exists class vmware(Plugin, RedHatPlugin): """VMWare related information """ - def checkenabled(self): - return exists("/usr/bin/vmware") + + files = ('/usr/bin/vmware') def setup(self): self.collectExtOutput("/usr/bin/vmware -v") diff --git a/sos/plugins/x11.py b/sos/plugins/x11.py index 16b29d74..2718159e 100644 --- a/sos/plugins/x11.py +++ b/sos/plugins/x11.py @@ -18,8 +18,8 @@ from os.path import exists class x11(Plugin, RedHatPlugin): """X related information """ - def checkenabled(self): - return exists("/etc/X11") + + files = ('/etc/X11') def setup(self): self.addCopySpecs([ diff --git a/sos/plugins/xinetd.py b/sos/plugins/xinetd.py index 6458cd5c..f8a8c644 100644 --- a/sos/plugins/xinetd.py +++ b/sos/plugins/xinetd.py @@ -20,8 +20,9 @@ import os class xinetd(Plugin, RedHatPlugin): """xinetd information """ - def checkenabled(self): - return self.isInstalled("xinetd") or os.path.exists("/etc/xinetd.conf") + + files = ('/etc/xinetd.conf') + packages = ('xinetd') def setup(self): self.addCopySpec("/etc/xinetd.conf") diff --git a/sos/plugins/yum.py b/sos/plugins/yum.py index 0c2ad2f0..19722461 100644 --- a/sos/plugins/yum.py +++ b/sos/plugins/yum.py @@ -19,14 +19,11 @@ class yum(Plugin, RedHatPlugin): """yum information """ + files = ('/etc/yum.conf') + packages = ('yum') optionList = [("yumlist", "list repositories and packages", "slow", False)] optionList = [("yumdebug", "gather yum debugging data", "slow", False)] - def checkenabled(self): - self.files = [ "/etc/yum.conf" ] - self.packages = [ "yum" ] - return Plugin.checkenabled(self) - def analyze(self): # repo sanity checking # TODO: elaborate/validate actual repo files, however this directory should |