From d86f92037000e7a5ac924543a74616de067837fc Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Tue, 16 Sep 2014 16:29:49 +0100 Subject: [sosreport] fix use of -o and -n without --profile Break the logic of the combined 'onlyplugins' and profile check out to make it more readable and fix a bug that caused all default plugins to be enabled when running '-o someplug'. Signed-off-by: Bryn M. Reeves --- sos/sosreport.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sos/sosreport.py b/sos/sosreport.py index 49d5910b..699d0352 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -827,6 +827,7 @@ class SoSReport(object): plugins = helper.get_modules() self.plugin_names = deque() self.profiles = set() + using_profiles = len(self.opts.profiles) # validate and load plugins for plug in plugins: plugbase, ext = os.path.splitext(plug) @@ -873,7 +874,9 @@ class SoSReport(object): self._skip(plugin_class, _("not default")) continue - if self._is_not_specified(plugbase) and not in_profile: + # true when the null (empty) profile is active + default_profile = not using_profiles and in_profile + if self._is_not_specified(plugbase) and default_profile: self._skip(plugin_class, _("not specified")) continue -- cgit