aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2013-04-29 17:35:05 +0100
committerBryn M. Reeves <bmr@redhat.com>2013-04-29 17:35:05 +0100
commitf28c908f8532665b19450feba28b0ffc06677834 (patch)
treeb2fdde8742d5744f642d3457f77a46b7f2a80414
parentb8c8700b6bef3aee189384d2fa7848f23b2b3278 (diff)
downloadsos-f28c908f8532665b19450feba28b0ffc06677834.tar.gz
Remove redundant check_enabled() and fix formatting in abrt.py
The abrt plug-in's check_enabled() just checks for one package and one file; add .packages and .files members to the plug-in class and delete the method. Also tidies up some long lines and string formatting. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/abrt.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/sos/plugins/abrt.py b/sos/plugins/abrt.py
index b1cdd1d6..148d57a1 100644
--- a/sos/plugins/abrt.py
+++ b/sos/plugins/abrt.py
@@ -22,15 +22,15 @@ class Abrt(Plugin, RedHatPlugin):
"""
plugin_name = "abrt"
+ packages = ('abrt-cli',)
+ files = ('/var/spool/abrt',)
- option_list = [("backtraces", 'collect backtraces for every report', 'slow', False)]
-
- def check_enabled(self):
- return self.is_installed("abrt-cli") or \
- exists("/var/spool/abrt")
+ option_list = [("backtraces", 'collect backtraces for every report',
+ 'slow', False)]
def do_backtraces(self):
- ret, output, rtime = self.call_ext_prog('sqlite3 /var/spool/abrt/abrt-db \'select UUID from abrt_v4\'')
+ ret, output, rtime = self.call_ext_prog('sqlite3 '
+ + '/var/spool/abrt/abrt-db \'select UUID from abrt_v4\'')
try:
for uuid in output.split():
self.add_cmd_output("abrt-cli -ib %s" % uuid,
@@ -39,7 +39,8 @@ class Abrt(Plugin, RedHatPlugin):
pass
def setup(self):
- self.add_cmd_output("abrt-cli -lf",
- suggest_filename="abrt-log")
+ self.add_cmd_output("abrt-cli -lf", suggest_filename="abrt-log")
if self.get_option('backtraces'):
self.do_backtraces()
+
+