commit ef485ea1d610a0679f86b39e39e7955f00b4351d
Author: Bryn M. Reeves <bmr@redhat.com>
Date: Wed Oct 30 15:05:56 2013 +0000
Fix config file regression
Changes in the organisation of sos in commit 6ea48cb broke the
reading of custom configuration files (either the default
/etc/sos.conf or one specified on the command line using
--config-file):
Traceback (most recent call last):
File "/usr/sbin/sosreport", line 23, in <module>
main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1167, in main
sos.execute()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1133, in execute
self._set_tunables()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 798, in _set_tunables
if not opt.split('.')[0] in self.disabled:
AttributeError: 'SoSReport' object has no attribute 'disabled'
The code attempts to reference the obsolete 'disabled' list of
plug-ins (rather than calling self._get_disabled_plugins()) and
failed to initialise the plugopts list to an empty deque.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 1b13826..afe61f2 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -465,7 +465,8 @@ class SoSOptions(object):
help="enable these plugins only", default = deque())
parser.add_option("-k", "--plugin-option", action="append",
dest="plugopts", type="string",
- help="plugin options in plugname.option=value format (see -l)")
+ help="plugin options in plugname.option=value format (see -l)",
+ default = deque())
parser.add_option("-a", "--alloptions", action="store_true",
dest="usealloptions", default=False,
help="enable all options for loaded plugins")
@@ -801,7 +802,7 @@ class SoSReport(object):
self.opts.plugopts = deque()
for opt, val in self.config.items("tunables"):
- if not opt.split('.')[0] in self.disabled:
+ if not opt.split('.')[0] in self._get_disabled_plugins():
self.opts.plugopts.append(opt + "=" + val)
if self.opts.plugopts:
opts = {}