aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-12-13 01:11:04 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-12-13 01:11:04 +0000
commit99c7c2370d140e74699e75307805de33abf56b02 (patch)
tree9918788306e247def29ab33799b4dfd8d44c6793
parent4da3c8af2c9f2865985071f4f24f00d3d8fb4fcc (diff)
downloadsos-99c7c2370d140e74699e75307805de33abf56b02.tar.gz
Fix sar file collection and error reporting
-rw-r--r--sos/plugins/sar.py8
1 files 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*")