Blame SOURCES/sos-bz1019516-fix-config-file-regression.patch

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