Change class variables to instance variables

TempestConf has a set of class variables that do not need to be
class variables because there are no multiple instances of
TempestConf class that could share the value.

The reason why we need to move the class variables to instance
variables is that some unit tests under certain conditions were
failing because multiple unit tests were changing the
TempestConf.priority_sectionkeys value.

Change-Id: Ic6f51be112aa9f93904fcab289d78a7e06f20f62
This commit is contained in:
Lukáš Piwowarski 2022-10-21 16:09:36 +02:00 committed by Lukas Piwowarski
parent 29cc5000c6
commit 6488be3e82

View File

@ -23,18 +23,20 @@ import tempest.config
class TempestConf(configparser.ConfigParser):
# causes the config parser to preserve case of the options
optionxform = str
# set of pairs `(section, key)` which have a higher priority (are
# user-defined) and will usually not be overwritten by `set()`
priority_sectionkeys = set()
CONF = tempest.config.TempestConfigPrivate(parse_conf=False)
def __init__(self, write_credentials=True, **kwargs):
# causes the config parser to preserve case of the options
self.optionxform = str
# set of pairs `(section, key)` which have a higher priority (are
# user-defined) and will usually not be overwritten by
# `TempestConf.set()`
self.priority_sectionkeys = set()
self.write_credentials = write_credentials
configparser.ConfigParser.__init__(self, **kwargs)
super().__init__(self, **kwargs)
def get_bool_value(self, value):
"""Returns boolean value of the string value given.