aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-09-16 16:29:49 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-09-16 17:45:08 +0100
commitd86f92037000e7a5ac924543a74616de067837fc (patch)
tree9e32866459d38a84e52ba004c55efc674bd1e8d8
parent8ace503f4e59582213812a7631183b253e8c8ca6 (diff)
downloadsos-d86f92037000e7a5ac924543a74616de067837fc.tar.gz
[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 <bmr@redhat.com>
-rw-r--r--sos/sosreport.py5
1 files changed, 4 insertions, 1 deletions
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