From 237b0157e98c6412c77b32d6d1cedc7afd0b02e4 Mon Sep 17 00:00:00 2001 From: Jesse Jaggars Date: Thu, 8 Mar 2012 11:34:22 -0600 Subject: fixing some local variable abuse --- sos/plugins/__init__.py | 5 +++-- sos/plugins/general.py | 13 +++++++------ 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") -- cgit