Use tempest.conf when running under tempest
This change switches to a global config for heat_integrationtests, and makes that global config the tempest config when running under tempest. After the transition to tempest init_conf won't be required at all. blueprint tempest-plugin-support Change-Id: Id22e7a03601db5adfc0b428004a75990278369a6
This commit is contained in:
parent
80b8ce19f3
commit
6b576ffc16
@ -16,6 +16,8 @@ from oslo_config import cfg
|
||||
|
||||
import heat_integrationtests
|
||||
|
||||
_CONF = None
|
||||
|
||||
service_available_group = cfg.OptGroup(name="service_available",
|
||||
title="Available OpenStack Services")
|
||||
|
||||
@ -162,6 +164,9 @@ HeatGroup = [
|
||||
|
||||
|
||||
def init_conf(read_conf=True):
|
||||
global _CONF
|
||||
if _CONF:
|
||||
return _CONF
|
||||
|
||||
default_config_files = None
|
||||
if read_conf:
|
||||
@ -171,13 +176,13 @@ def init_conf(read_conf=True):
|
||||
if os.path.isfile(confpath):
|
||||
default_config_files = [confpath]
|
||||
|
||||
conf = cfg.ConfigOpts()
|
||||
conf(args=[], project='heat_integrationtests',
|
||||
_CONF = cfg.ConfigOpts()
|
||||
_CONF(args=[], project='heat_integrationtests',
|
||||
default_config_files=default_config_files)
|
||||
|
||||
for group, opts in list_opts():
|
||||
conf.register_opts(opts, group=group)
|
||||
return conf
|
||||
_CONF.register_opts(opts, group=group)
|
||||
return _CONF
|
||||
|
||||
|
||||
def list_opts():
|
||||
|
@ -33,6 +33,7 @@ class HeatTempestPlugin(plugins.TempestPlugin):
|
||||
heat_config.ServiceAvailableGroup)
|
||||
config.register_opt_group(conf, heat_config.heat_group,
|
||||
heat_config.HeatGroup)
|
||||
heat_config._CONF = config.CONF
|
||||
|
||||
def get_opt_lists(self):
|
||||
return [(heat_config.heat_group.name,
|
||||
|
Loading…
Reference in New Issue
Block a user