From b9c222ec04dd1eeb5608ee68b7c794bac31767e0 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Fri, 22 Mar 2019 12:04:52 +0000 Subject: [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 --- sos/plugins/unpackaged.py | 4 ++++ 1 file changed, 4 insertions(+) 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( -- cgit