sos/SOURCES/sos-bz1912910-empty-file-st...

34 lines
1.2 KiB
Diff

From 03642cf2e5619f11c762b63c61c9c69fb2b00cdf Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Tue, 8 Dec 2020 19:33:07 +0100
Subject: [PATCH] [plugins] Dont stop collecting by empty specfile when
sizelimit=0
When sizelimit=0, collecting an empty file would set limit_reached
wrongly and stop collecting further files. Let fix this corner case.
Resolves: #2330
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
sos/report/plugins/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
index deb46c93..510e116e 100644
--- a/sos/report/plugins/__init__.py
+++ b/sos/report/plugins/__init__.py
@@ -1483,7 +1483,7 @@ class Plugin(object):
self._add_copy_paths([_file])
# in the corner case we just reached the sizelimit, we
# should collect the whole file and stop
- limit_reached = (current_size == sizelimit)
+ limit_reached = (sizelimit and current_size == sizelimit)
if self.manifest:
self.manifest.files.append({
'specification': copyspec,
--
2.26.2