From d9e1c2a6dafd50146958c143ff0f39237788d10a Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Mon, 26 Jan 2015 00:09:11 +0000 Subject: [PATCH 70/93] [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 --- sos/plugins/logs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sos/plugins/logs.py b/sos/plugins/logs.py index 15ae26a..55468cb 100644 --- a/sos/plugins/logs.py +++ b/sos/plugins/logs.py @@ -37,12 +37,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:] @@ -61,7 +61,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: -- 1.9.3