From b3d9fdf568e25997eb006e575d26fb301b91414b Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Tue, 9 Jul 2019 13:15:48 +0200 Subject: [PATCH] [sar] collect whole sar log dir Currently, sosreport does not collect files in saYYYYMMDD or similar format. Assuming sar log dir contains only sar related data it is safe to collect whole dir (up to size limit, from newest to oldest files). Resolves: #1700 Signed-off-by: Pavel Moravec --- sos/plugins/sar.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py index 492c38a21..5a1b9f30a 100644 --- a/sos/plugins/sar.py +++ b/sos/plugins/sar.py @@ -22,24 +22,9 @@ class Sar(Plugin,): option_list = [("all_sar", "gather all system activity records", "", False)] - # size-limit SAR data collected by default (MB) - sa_size = 20 - def setup(self): - if self.get_option("all_sar"): - self.sa_size = 0 - - # Copy all sa??, sar??, sa??.* and sar??.* files, which will net - # compressed and uncompressed versions, typically. - for suffix in ('', '.*'): - self.add_copy_spec( - os.path.join(self.sa_path, "sa[0-3][0-9]" + suffix), - sizelimit=self.sa_size, tailit=False - ) - self.add_copy_spec( - os.path.join(self.sa_path, "sar[0-3][0-9]" + suffix), - sizelimit=self.sa_size, tailit=False - ) + self.add_copy_spec(self.sa_path, + sizelimit=0 if self.get_option("all_sar") else None) try: dir_list = os.listdir(self.sa_path)