diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2df7339e6b..fef6764214 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,17 @@ Changelog .. Release notes for existing releases are MUTABLE! If there is something that was missed or can be improved, feel free to change it! +[unreleased] +------------ + +Fixed +~~~~~ + +* [verification component] Make config parser case sensitivity in + configure-verifier + + `Launchpad-bug #1877930 `_ + [3.1.0] - 2020-05-08 -------------------- diff --git a/rally/cli/commands/verify.py b/rally/cli/commands/verify.py index 923b537eec..7ee27e200d 100644 --- a/rally/cli/commands/verify.py +++ b/rally/cli/commands/verify.py @@ -333,6 +333,7 @@ class VerifyCommands(object): if extra_options: if os.path.isfile(extra_options): conf = configparser.ConfigParser() + conf.optionxform = str conf.read(extra_options) extra_options = dict(conf._sections) for s in extra_options: diff --git a/rally/verification/utils.py b/rally/verification/utils.py index 2ca452462c..ae75c238e3 100644 --- a/rally/verification/utils.py +++ b/rally/verification/utils.py @@ -73,6 +73,7 @@ def create_dir(dir_path): def extend_configfile(extra_options, conf_path): conf_object = configparser.ConfigParser() + conf_object.optionxform = str conf_object.read(conf_path) conf_object = add_extra_options(extra_options, conf_object) @@ -86,6 +87,7 @@ def extend_configfile(extra_options, conf_path): def add_extra_options(extra_options, conf_object): + conf_object.optionxform = str for section in extra_options: if section not in (conf_object.sections() + ["DEFAULT"]): conf_object.add_section(section) diff --git a/tests/unit/verification/test_utils.py b/tests/unit/verification/test_utils.py index 1b10edda1d..ef1773c82a 100644 --- a/tests/unit/verification/test_utils.py +++ b/tests/unit/verification/test_utils.py @@ -80,11 +80,14 @@ class UtilsTestCase(test.TestCase): def test_add_extra_options(self): conf = configparser.ConfigParser() extra_options = {"section": {"foo": "bar"}, - "section2": {"option": "value"}} + "section2": {"option": "value"}, + "section3": {"CamelCaseOption": "CamelCaseValue"}} conf = utils.add_extra_options(extra_options, conf) - expected = {"section": ("foo", "bar"), "section2": ("option", "value")} + expected = {"section": ("foo", "bar"), + "section2": ("option", "value"), + "section3": ("CamelCaseOption", "CamelCaseValue")} for section, option in expected.items(): result = conf.items(section) self.assertIn(option, result)