aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordluong <dluong@redhat.com>2019-09-26 23:25:10 -0400
committerBryn M. Reeves <bmr@redhat.com>2019-10-08 15:10:51 +0100
commit26d097b117eaa16e84cb2673622a7cfc41ebda7a (patch)
tree7321a5ea3dcb9d7dcf3ab33095d19844e4dbcbd5
parent412ece36410ed2465dfdcf4e432a872154c17c0d (diff)
downloadsos-26d097b117eaa16e84cb2673622a7cfc41ebda7a.tar.gz
[plugin] add_copy_spec handle same file diff sizelimit
This change allows add_copy_spec to handle the same file with the different size limits. For example: log = evm.log all_logs = *.log miq_log_dir = '/var/www/miq/vmdb/log/' self.add_copy_spec([ os.path.join(self.miq_log_dir, log) ], sizelimit=0) self.add_copy_spec([ os.path.join(self.miq_log_dir, x) for x in self.all_logs ]) Here, it would copy evm.log first with no sizelimit since add_copy_spec was called on 'log' first. It would then skip the next time it tries to get added from the glob contained in all_logs. Closes: #1786 Resolves: #1802 Signed-off by: David Luong <dluong@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index d3d42e79..713c7278 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -912,6 +912,9 @@ class Plugin(object):
limit_reached = False
for _file in files:
+ if _file in self.copy_paths:
+ self._log_debug("skipping redundant file '%s'" % _file)
+ continue
if self._is_forbidden_path(_file):
self._log_debug("skipping forbidden path '%s'" % _file)
continue