aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuhito Hagio <k-hagio-ab@nec.com>2020-03-11 16:02:26 -0400
committerJake Hunsaker <jhunsake@redhat.com>2020-03-18 09:49:14 -0400
commit436e4a85c703b85695af4c343f6ae3ce3e56def0 (patch)
tree867b319b836ef7dbf8b18c847f1fe27e35ecd2e7
parent5b5302e7a7b1931d51e4960a9a56f14cd0c855c1 (diff)
downloadsos-436e4a85c703b85695af4c343f6ae3ce3e56def0.tar.gz
[sar] Fix "sar: could not list /var/log/sa/*" warning
Commit d334c5dedbcf ("[sar] Fix the parameter specified in add_copy_spec() to wildcard") appended the wildcard to the sa_path. But since it is passed to os.listdir() as is, the following warning is printed and later commands are not collected. [plugin:sar] sar: could not list /var/log/sa/* Resolves: #1978 Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/plugins/sar.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py
index ba637dc0..fd871351 100644
--- a/sos/plugins/sar.py
+++ b/sos/plugins/sar.py
@@ -18,12 +18,12 @@ class Sar(Plugin,):
profiles = ('system', 'performance')
packages = ('sysstat',)
- sa_path = '/var/log/sa/*'
+ sa_path = '/var/log/sa'
option_list = [("all_sar", "gather all system activity records",
"", False)]
def setup(self):
- self.add_copy_spec(self.sa_path,
+ self.add_copy_spec(os.path.join(self.sa_path, '*'),
sizelimit=0 if self.get_option("all_sar") else None,
tailit=False)
@@ -56,11 +56,11 @@ class Sar(Plugin,):
class RedHatSar(Sar, RedHatPlugin):
- sa_path = '/var/log/sa/*'
+ sa_path = '/var/log/sa'
class DebianSar(Sar, DebianPlugin, UbuntuPlugin):
- sa_path = '/var/log/sysstat/*'
+ sa_path = '/var/log/sysstat'
# vim: set et ts=4 sw=4 :