Blob Blame History Raw
From 2c04f56675b36f59ab4d4cb455efeb7d71badb74 Mon Sep 17 00:00:00 2001
From: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Date: Tue, 22 May 2018 15:29:47 -0400
Subject: [PATCH] [logs] rework: collect journalctl verbosed logs with
 --all-logs only

commit 7bc90f618f0549279544d26effae2e5197d85e2b ("[logs] collect
journalctl verbosed logs with --all-logs only") did not suppress
the journalctl verbosed logs by default.  Let's rework it.

Related: #1225
Resolves: #1310

Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/logs.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py
index 1d18bad8..c67d3e66 100644
--- a/sos/plugins/logs.py
+++ b/sos/plugins/logs.py
@@ -34,10 +34,10 @@ class Logs(Plugin):
         self.add_copy_spec("/var/log/boot.log", sizelimit=self.limit)
         self.add_copy_spec("/var/log/cloud-init*", sizelimit=self.limit)
         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'):
+            self.add_journal(boot="this", allfields=True, output="verbose")
             syslog_conf = self.join_sysroot("/etc/syslog.conf")
             logs = self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+", syslog_conf)
             if self.is_installed("rsyslog") \
-- 
2.13.6