aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-12-11 18:13:16 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-12-11 18:13:16 +0000
commit6a448405a3f5b34f005b7e9363b252440a96448a (patch)
tree5209a510ef7e3571d63129109e93de9b20df7626
parent75c3d16176aec599f7e3e7c7e44c0afb337d54b7 (diff)
downloadsos-6a448405a3f5b34f005b7e9363b252440a96448a.tar.gz
Delete selinux module's analyze() method
The analyze machinery hasn't been hooked up since commit 6ea48cb. The use of these methods has also not been especially clear: some modules trigger additional file/command collection here while others only add alerts (the original purpose of analyze()). Other module call the addAlert() interface from their setup() method. Move the SELinux module's analyze functionality into the main setup() method but make it conditional on setroubleshoot being installed as it's necessary for the current implementation.
-rw-r--r--sos/plugins/selinux.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/sos/plugins/selinux.py b/sos/plugins/selinux.py
index 0f80ed9a..95144138 100644
--- a/sos/plugins/selinux.py
+++ b/sos/plugins/selinux.py
@@ -26,15 +26,9 @@ class selinux(Plugin, RedHatPlugin):
self.collectExtOutput("/sbin/fixfiles check")
self.addForbiddenPath("/etc/selinux/targeted")
- def checkenabled(self):
- try:
- if self.collectOutputNow("/usr/sbin/sestatus", root_symlink = "sestatus").split(":")[1].strip() == "disabled":
- return False
- except:
- pass
- return True
+ if not self.policy().pkgByName('setroubleshoot'):
+ return
- def analyze(self):
# Check for SELinux denials and capture raw output from sealert
if self.policy().runlevelDefault() in self.policy().runlevelByService("setroubleshoot"):
# TODO: fixup regex for more precise matching
@@ -44,3 +38,10 @@ class selinux(Plugin, RedHatPlugin):
self.collectExtOutput("%s" % i)
self.addAlert("There are numerous selinux errors present and "+
"possible fixes stated in the sealert output.")
+ def checkenabled(self):
+ try:
+ if self.collectOutputNow("/usr/sbin/sestatus", root_symlink = "sestatus").split(":")[1].strip() == "disabled":
+ return False
+ except:
+ pass
+ return True