summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Morris <john@zultron.com>2012-09-03 12:07:03 -0500
committerSol Jerome <sol.jerome@gmail.com>2012-09-03 15:41:44 -0500
commite73fc4c7eead30524b5688ec3580ff845e735e36 (patch)
tree5e2fa69a0638b7a0478a57c5e0eed7116f114489
parent1cfc2c6fae3e473e2daa4e62cc6676710dbd1ae4 (diff)
downloadbcfg2-e73fc4c7eead30524b5688ec3580ff845e735e36.tar.gz
bcfg2-e73fc4c7eead30524b5688ec3580ff845e735e36.tar.bz2
bcfg2-e73fc4c7eead30524b5688ec3580ff845e735e36.zip
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 <sol.jerome@gmail.com>
-rw-r--r--src/lib/Bcfg2/Options.py5
1 files changed, 5 insertions, 0 deletions
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