aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2019-03-22 12:04:52 +0000
committerBryn M. Reeves <bmr@redhat.com>2019-03-22 18:31:09 +0000
commitb9c222ec04dd1eeb5608ee68b7c794bac31767e0 (patch)
tree1e6ad808d594985a30676dc07d0df5208d6f9cb5
parent73f07166064ff9cc528e77b561adc2ad05c11273 (diff)
downloadsos-b9c222ec04dd1eeb5608ee68b7c794bac31767e0.tar.gz
[unpackaged] check plugin predicate before processing packages
The unpackaged plugin is unusual in that it does a lot of costly processing in Python, without ever calling out to an external binary. This means that the normal, automatic predicate testing hooks are not executed until we come to add the final string to the archive (by which time we've already done all the work). Make a special case for this plugin, and test the current plugin predicate before operating on package lists. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/unpackaged.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sos/plugins/unpackaged.py b/sos/plugins/unpackaged.py
index 91de9de2..10896d06 100644
--- a/sos/plugins/unpackaged.py
+++ b/sos/plugins/unpackaged.py
@@ -63,6 +63,10 @@ class Unpackaged(Plugin, RedHatPlugin):
expanded.append(f)
return expanded
+ # Check command predicate to avoid costly processing
+ if not self.test_predicate(cmd=True):
+ return
+
all_fsystem = []
all_frpm = set(os.path.realpath(x)
for x in self.policy.mangle_package_path(