aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2017-08-31 17:08:59 +0200
committerBryn M. Reeves <bmr@redhat.com>2017-10-27 14:18:52 +0100
commit975496614693e21ddad920d44492739e8542687d (patch)
tree380f7dfca3904855f8d5c055f62785b43d5e7593
parent81b2623ea9386335cf2dd59e299861c22155b75c (diff)
downloadsos-975496614693e21ddad920d44492739e8542687d.tar.gz
[logs] honour --all-logs every time
Don't limit logs by size when --all-logs is used. Related to: #1083 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/logs.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py
index 592671c3..5d693abf 100644
--- a/sos/plugins/logs.py
+++ b/sos/plugins/logs.py
@@ -29,7 +29,8 @@ class Logs(Plugin):
"/etc/rsyslog.d"
])
- self.limit = self.get_option("log_size")
+ self.limit = (None if self.get_option("all_logs")
+ else self.get_option("log_size"))
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")
@@ -93,15 +94,15 @@ class DebianLogs(Logs, DebianPlugin, UbuntuPlugin):
def setup(self):
super(DebianLogs, self).setup()
if not self.get_option("all_logs"):
- limit = self.get_option("log_size")
- self.add_copy_spec("/var/log/syslog", sizelimit=limit)
- self.add_copy_spec("/var/log/syslog.1", sizelimit=limit)
- self.add_copy_spec("/var/log/kern.log", sizelimit=limit)
- self.add_copy_spec("/var/log/kern.log.1", sizelimit=limit)
- self.add_copy_spec("/var/log/udev", sizelimit=limit)
- self.add_copy_spec("/var/log/dist-upgrade", sizelimit=limit)
- self.add_copy_spec("/var/log/installer", sizelimit=limit)
- self.add_copy_spec("/var/log/unattended-upgrades", sizelimit=limit)
+ self.add_copy_spec("/var/log/syslog", sizelimit=self.limit)
+ self.add_copy_spec("/var/log/syslog.1", sizelimit=self.limit)
+ self.add_copy_spec("/var/log/kern.log", sizelimit=self.limit)
+ self.add_copy_spec("/var/log/kern.log.1", sizelimit=self.limit)
+ self.add_copy_spec("/var/log/udev", sizelimit=self.limit)
+ self.add_copy_spec("/var/log/dist-upgrade", sizelimit=self.limit)
+ self.add_copy_spec("/var/log/installer", sizelimit=self.limit)
+ self.add_copy_spec("/var/log/unattended-upgrades",
+ sizelimit=self.limit)
self.add_cmd_output('ls -alRh /var/log/')
else:
self.add_copy_spec("/var/log/")