Fix pep8 issues
Apparently functional tests code caused oslo.config to try to parse cli arguments. After that openstack/common/log.py tried to register cli opts, but failed because cli opts can't be registered after cli args were parsed. This patch moves config initialization to a separate method to prevent cli args from being parsed on the load time Change-Id: If40409b306a7aabdbd3cf467319a1574b440a690
This commit is contained in:
parent
eae00b9970
commit
414fb984c5
@ -117,6 +117,8 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes,
|
||||
def setUpClass(cls):
|
||||
super(MuranoBase, cls).setUpClass()
|
||||
|
||||
cfg.load_config()
|
||||
|
||||
cls.client = Client(user=CONF.murano.user,
|
||||
password=CONF.murano.password,
|
||||
tenant=CONF.murano.tenant,
|
||||
|
@ -49,12 +49,13 @@ def register_config(config, config_group, config_opts):
|
||||
config.register_group(config_group)
|
||||
config.register_opts(config_opts, config_group)
|
||||
|
||||
__location = os.path.realpath(os.path.join(os.getcwd(),
|
||||
os.path.dirname(__file__)))
|
||||
|
||||
path = os.path.join(__location, "config.conf")
|
||||
def load_config():
|
||||
__location = os.path.realpath(os.path.join(os.getcwd(),
|
||||
os.path.dirname(__file__)))
|
||||
path = os.path.join(__location, "config.conf")
|
||||
|
||||
if os.path.exists(path):
|
||||
cfg.CONF([], project='muranointegration', default_config_files=[path])
|
||||
if os.path.exists(path):
|
||||
cfg.CONF([], project='muranointegration', default_config_files=[path])
|
||||
|
||||
register_config(cfg.CONF, murano_group, MuranoGroup)
|
||||
register_config(cfg.CONF, murano_group, MuranoGroup)
|
||||
|
Loading…
Reference in New Issue
Block a user