aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/__init__.py5
-rw-r--r--sos/plugins/general.py13
2 files changed, 10 insertions, 8 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index beff0acb..b9be263a 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -348,7 +348,8 @@ class Plugin(object):
# Truncate the first file (others would likely be compressed),
# ensuring we get at least some logs
# FIXME: figure this out for jython
- if flog == files[0] and limit_reached:
+ if len(files) == 1 and limit_reached:
+ flog = files[0]
self.collectExtOutput("tail -c%d %s" % (sizelimit, flog),
"tail_" + os.path.basename(flog), flog[1:] + ".tailed")
@@ -384,7 +385,7 @@ class Plugin(object):
return (status == 0)
- def collectExtOutput(self, exe, suggest_filename = None, root_symlink = None, timeout = 300):
+ def collectExtOutput(self, exe, suggest_filename=None, root_symlink=None, timeout=300):
"""
Run a program and collect the output
"""
diff --git a/sos/plugins/general.py b/sos/plugins/general.py
index 1ba95176..7fe689c9 100644
--- a/sos/plugins/general.py
+++ b/sos/plugins/general.py
@@ -39,15 +39,16 @@ class general(Plugin):
"/var/lib/dbus/machine-id",
"/etc/exports",
"/root/anaconda-ks.cfg"])
+
self.collectExtOutput("/bin/dmesg", suggest_filename="dmesg_now")
- self.addCopySpecLimit("/var/log/messages*", sizelimit = self.getOption("syslogsize"))
- self.addCopySpecLimit("/var/log/secure*", sizelimit = self.getOption("syslogsize"))
+ self.addCopySpecLimit("/var/log/messages*", sizelimit=self.getOption("syslogsize"))
+ self.addCopySpecLimit("/var/log/secure*", sizelimit=self.getOption("syslogsize"))
self.collectExtOutput("/usr/bin/hostid")
- self.collectExtOutput("/bin/hostname", root_symlink = "hostname")
- self.collectExtOutput("/bin/date", root_symlink = "date")
- self.collectExtOutput("/usr/bin/uptime", root_symlink = "uptime")
+ self.collectExtOutput("/bin/hostname", root_symlink="hostname")
+ self.collectExtOutput("/bin/date", root_symlink="date")
+ self.collectExtOutput("/usr/bin/uptime", root_symlink="uptime")
self.collectExtOutput("/bin/dmesg")
- self.collectExtOutput("/usr/sbin/alternatives --display java", root_symlink = "java")
+ self.collectExtOutput("/usr/sbin/alternatives --display java", root_symlink="java")
self.collectExtOutput("/usr/bin/readlink -f /usr/bin/java")