From e73fc4c7eead30524b5688ec3580ff845e735e36 Mon Sep 17 00:00:00 2001 From: John Morris Date: Mon, 3 Sep 2012 12:07:03 -0500 Subject: Options.py: Preserve config file option name case See this link: http://docs.python.org/library/configparser.html#ConfigParser.RawConfigParser.optionxform By default, RawConfigParser squashes option names to lower case. The ZBCA plugin, before plugin configuration was moved from data directories to /etc/bcfg2.conf, relied on option name case to be preserved because X509v3 extension names use mixed case. Moving the ZBCA config into bcfg2.conf breaks the plugin because pyOpenSSL no longer recognizes the extension names. This patch causes RawConfigParser to preserve option name case. This is anticipated to break things if users have placed upper-case characters in config file option names. (cherry picked from commit 043706ab10034461f64a53060d8ba54f278c2e0c) Signed-off-by: Sol Jerome --- src/lib/Bcfg2/Options.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py index 76868e991..a69300178 100644 --- a/src/lib/Bcfg2/Options.py +++ b/src/lib/Bcfg2/Options.py @@ -21,6 +21,11 @@ DEFAULT_INSTALL_PREFIX = '/usr' class DefaultConfigParser(ConfigParser.ConfigParser): + def __init__(self,*args,**kwargs): + """Make configuration options case sensitive""" + ConfigParser.ConfigParser.__init__(self,*args,**kwargs) + self.optionxform = str + def get(self, section, option, **kwargs): """ convenience method for getting config items """ default = None -- cgit v1.2.3-1-g7c22