diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2016-06-01 19:14:02 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2016-06-02 16:11:40 +0100 |
commit | 484e47809f02d6f3b3f32f5a1c9e06c395bf1c7f (patch) | |
tree | b5cc864de6e31d5cf5d7586cf5d1b41d3ea80b0b | |
parent | 3496658a6b903d57b35b3669b0455f4c18c6ad66 (diff) | |
download | sos-484e47809f02d6f3b3f32f5a1c9e06c395bf1c7f.tar.gz |
[logs] convert to add_journal interface
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/logs.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py index 16cb976e..b6551e73 100644 --- a/sos/plugins/logs.py +++ b/sos/plugins/logs.py @@ -32,11 +32,9 @@ class Logs(Plugin): self.limit = self.get_option("log_size") self.add_copy_spec_limit("/var/log/boot.log", sizelimit=self.limit) self.add_copy_spec_limit("/var/log/cloud-init*", sizelimit=self.limit) - self.add_cmd_output([ - "journalctl --disk-usage", - "journalctl --all --this-boot --no-pager", - "journalctl --all --this-boot --no-pager -o verbose", - ]) + self.add_journal(boot="this") + self.add_journal(boot="this", allfields=True, output="verbose") + self.add_cmd_output("journalctl --disk-usage") if self.get_option('all_logs'): syslog_conf = self.join_sysroot("/etc/syslog.conf") @@ -84,10 +82,10 @@ class RedHatLogs(Logs, RedHatPlugin): except: days = 3 if self.get_option("all_logs"): - since_opt = "" + since = "" else: - since_opt = '--since="-%ddays"' % days - self.add_cmd_output('journalctl --all %s' % since_opt) + since = "-%ddays" % days + self.add_journal(since=since) class DebianLogs(Logs, DebianPlugin, UbuntuPlugin): |