diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2017-01-09 11:44:21 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2017-02-20 16:56:37 +0000 |
commit | f866f756e36057e4aeac32fbee585d1c62002b5f (patch) | |
tree | 3a02af2314af2a7b535e476fe708bc6a0728a155 | |
parent | 3f791204833783b838c35d73f74070f6c4e145a7 (diff) | |
download | sos-f866f756e36057e4aeac32fbee585d1c62002b5f.tar.gz |
[abrt] replace all failing commands
Fixing all abrt-cli calls since none further has proper arguments,
causing none call returns a valuable output.
Resolves: #911
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r-- | sos/plugins/abrt.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/sos/plugins/abrt.py b/sos/plugins/abrt.py index 276fc8e3..b5aabf81 100644 --- a/sos/plugins/abrt.py +++ b/sos/plugins/abrt.py @@ -27,23 +27,18 @@ class Abrt(Plugin, RedHatPlugin): files = ('/var/spool/abrt',) option_list = [ - ("backtraces", 'collect backtraces for every report', 'slow', False) + ("detailed", 'collect detailed info for every report', 'slow', False) ] - def do_backtraces(self): - result = self.call_ext_prog('sqlite3 ' - '/var/spool/abrt/abrt-db \'select UUID ' - 'from abrt_v4\'') - try: - for uuid in result['output'].split(): - self.add_cmd_output("abrt-cli -ib %s" % uuid, - suggest_filename=("backtrace_%s" % uuid)) - except IndexError: - pass + def info_detailed(self, list_file): + for line in open(list_file).read().splitlines(): + if line.startswith("Directory:"): + self.add_cmd_output("abrt-cli info -d '%s'" % line.split()[1]) def setup(self): - self.add_cmd_output("abrt-cli -lf", suggest_filename="abrt-log") - if self.get_option('backtraces'): - self.do_backtraces() + self.add_cmd_output("abrt-cli status") + list_file = self.get_cmd_output_now("abrt-cli list") + if self.get_option('detailed') and list_file: + self.info_detailed(list_file) # vim: set et ts=4 sw=4 : |