From f28c908f8532665b19450feba28b0ffc06677834 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Mon, 29 Apr 2013 17:35:05 +0100 Subject: 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 --- sos/plugins/abrt.py | 17 +++++++++-------- 1 file 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() + + -- cgit