diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2015-01-26 00:09:11 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2015-07-08 17:05:21 +0100 |
commit | b34ea0c6ea5449bbd2f4f9624e1644dc01b07e9d (patch) | |
tree | 02574d4ab985f223a49e22f0922b44220f57ca71 | |
parent | 78761114ea9cc1b33233db2186a5ff762e1ac2f2 (diff) | |
download | sos-b34ea0c6ea5449bbd2f4f9624e1644dc01b07e9d.tar.gz |
[logs] fix do_regex_find_all() use for --sysroot
The logs plugin searches syslog configuration files. When using
--sysroot the plugin needs to use join_sysroot() to open the
correct path.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/logs.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py index 2f86acc6..7957898e 100644 --- a/sos/plugins/logs.py +++ b/sos/plugins/logs.py @@ -38,12 +38,12 @@ class Logs(Plugin): ]) if self.get_option('all_logs'): - logs = self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+", - "/etc/syslog.conf") + syslog_conf = self.join_sysroot("/etc/syslog.conf") + logs = self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+", syslog_conf) if self.is_installed("rsyslog") \ or os.path.exists("/etc/rsyslog.conf"): logs += self.do_regex_find_all("^\S+\s+(-?\/.*$)\s+", - "/etc/rsyslog.conf") + rsyslog_conf) for i in logs: if i.startswith("-"): i = i[1:] @@ -74,7 +74,7 @@ class RedHatLogs(Logs, RedHatPlugin): messages = "/var/log/messages" self.add_copy_spec_limit("/var/log/secure*", sizelimit=self.limit) self.add_copy_spec_limit(messages + "*", sizelimit=self.limit) - # collect five days worth of logs by default if the system is + # collect three days worth of logs by default if the system is # configured to use the journal and not /var/log/messages if not os.path.exists(messages) and self.is_installed("systemd"): try: |