From 99c7c2370d140e74699e75307805de33abf56b02 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 13 Dec 2012 01:11:04 +0000 Subject: Fix sar file collection and error reporting --- sos/plugins/sar.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py index 0808b0d3..b3248cbf 100644 --- a/sos/plugins/sar.py +++ b/sos/plugins/sar.py @@ -40,9 +40,10 @@ class sar(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): # catch exceptions here to avoid races try: - dirList=listdir(self.sapath) - except: - self.soslog.error("sar path %s cannot be read" % self.sapath) + dirList=os.listdir(self.sapath) + except Exception, e: + self.soslog.error("sar path %s cannot be read: %s" + % (self.sapath, e)) return # find all the sa file that don't have an existing sar file @@ -54,3 +55,4 @@ class sar(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + "-A -f /var/log/sa/" + fname + "\"" self.collectExtOutput(sar_command, sar_filename, root_symlink=sar_filename) + self.addCopySpec("/var/log/sa/sar*") -- cgit