Adding placement auth options to oslo.config entry_points
To assist with automated configuration validation, we need entry points for oslo.config.opts for placement auth options. Change-Id: Ibaaa1600e6a14f3308024c4e22e3489ee21e7244
This commit is contained in:
parent
d6d6855234
commit
89fd50d0f9
@ -8,6 +8,7 @@ namespace = neutron.db
|
|||||||
namespace = neutron.extensions
|
namespace = neutron.extensions
|
||||||
namespace = nova.auth
|
namespace = nova.auth
|
||||||
namespace = ironic.auth
|
namespace = ironic.auth
|
||||||
|
namespace = placement.auth
|
||||||
namespace = oslo.log
|
namespace = oslo.log
|
||||||
namespace = oslo.db
|
namespace = oslo.db
|
||||||
namespace = oslo.policy
|
namespace = oslo.policy
|
||||||
|
@ -61,22 +61,59 @@ import neutron.plugins.ml2.drivers.mech_sriov.agent.common.config
|
|||||||
import neutron.wsgi
|
import neutron.wsgi
|
||||||
|
|
||||||
|
|
||||||
NOVA_GROUP = 'nova'
|
AUTH_GROUPS_OPTS = {
|
||||||
IRONIC_GROUP = 'ironic'
|
'nova': {
|
||||||
|
'deprecations': {
|
||||||
|
'nova.cafile': [
|
||||||
|
cfg.DeprecatedOpt('ca_certificates_file', group='nova')
|
||||||
|
],
|
||||||
|
'nova.insecure': [
|
||||||
|
cfg.DeprecatedOpt('api_insecure', group='nova')
|
||||||
|
],
|
||||||
|
'nova.timeout': [
|
||||||
|
cfg.DeprecatedOpt('url_timeout', group='nova')
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'ironic': {},
|
||||||
|
'placement': {}
|
||||||
|
}
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
||||||
deprecations = {'nova.cafile': [cfg.DeprecatedOpt('ca_certificates_file',
|
|
||||||
group=NOVA_GROUP)],
|
|
||||||
'nova.insecure': [cfg.DeprecatedOpt('api_insecure',
|
|
||||||
group=NOVA_GROUP)],
|
|
||||||
'nova.timeout': [cfg.DeprecatedOpt('url_timeout',
|
|
||||||
group=NOVA_GROUP)]}
|
|
||||||
|
|
||||||
_nova_options = ks_loading.register_session_conf_options(
|
def list_auth_opts(group):
|
||||||
CONF, NOVA_GROUP, deprecated_opts=deprecations)
|
group_conf = AUTH_GROUPS_OPTS.get(group)
|
||||||
_ironic_options = ks_loading.register_session_conf_options(
|
kwargs = {'conf': CONF, 'group': group}
|
||||||
CONF, IRONIC_GROUP)
|
deprecations = group_conf.get('deprecations')
|
||||||
|
if deprecations:
|
||||||
|
kwargs['deprecated_opts'] = deprecations
|
||||||
|
opts = ks_loading.register_session_conf_options(
|
||||||
|
**kwargs
|
||||||
|
)
|
||||||
|
opt_list = copy.deepcopy(opts)
|
||||||
|
opt_list.insert(0, ks_loading.get_auth_common_conf_options()[0])
|
||||||
|
# NOTE(mhickey): There are a lot of auth plugins, we just generate
|
||||||
|
# the config options for a few common ones
|
||||||
|
plugins = ['password', 'v2password', 'v3password']
|
||||||
|
for name in plugins:
|
||||||
|
for plugin_option in ks_loading.get_auth_plugin_conf_options(name):
|
||||||
|
if all(option.name != plugin_option.name for option in opt_list):
|
||||||
|
opt_list.append(plugin_option)
|
||||||
|
opt_list.sort(key=operator.attrgetter('name'))
|
||||||
|
return [(group, opt_list)]
|
||||||
|
|
||||||
|
|
||||||
|
def list_ironic_auth_opts():
|
||||||
|
return list_auth_opts('ironic')
|
||||||
|
|
||||||
|
|
||||||
|
def list_nova_auth_opts():
|
||||||
|
return list_auth_opts('nova')
|
||||||
|
|
||||||
|
|
||||||
|
def list_placement_auth_opts():
|
||||||
|
return list_auth_opts('placement')
|
||||||
|
|
||||||
|
|
||||||
def list_agent_opts():
|
def list_agent_opts():
|
||||||
@ -150,6 +187,10 @@ def list_opts():
|
|||||||
itertools.chain(
|
itertools.chain(
|
||||||
neutron.conf.common.ironic_opts)
|
neutron.conf.common.ironic_opts)
|
||||||
),
|
),
|
||||||
|
(neutron.conf.common.PLACEMENT_CONF_SECTION,
|
||||||
|
itertools.chain(
|
||||||
|
neutron.conf.common.placement_opts)
|
||||||
|
),
|
||||||
('quotas', neutron.conf.quota.core_quota_opts)
|
('quotas', neutron.conf.quota.core_quota_opts)
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -313,31 +354,3 @@ def list_sriov_agent_opts():
|
|||||||
('agent',
|
('agent',
|
||||||
neutron.conf.agent.agent_extensions_manager.AGENT_EXT_MANAGER_OPTS)
|
neutron.conf.agent.agent_extensions_manager.AGENT_EXT_MANAGER_OPTS)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def list_auth_opts():
|
|
||||||
opt_list = copy.deepcopy(_nova_options)
|
|
||||||
opt_list.insert(0, ks_loading.get_auth_common_conf_options()[0])
|
|
||||||
# NOTE(mhickey): There are a lot of auth plugins, we just generate
|
|
||||||
# the config options for a few common ones
|
|
||||||
plugins = ['password', 'v2password', 'v3password']
|
|
||||||
for name in plugins:
|
|
||||||
for plugin_option in ks_loading.get_auth_plugin_conf_options(name):
|
|
||||||
if all(option.name != plugin_option.name for option in opt_list):
|
|
||||||
opt_list.append(plugin_option)
|
|
||||||
opt_list.sort(key=operator.attrgetter('name'))
|
|
||||||
return [(NOVA_GROUP, opt_list)]
|
|
||||||
|
|
||||||
|
|
||||||
def list_ironic_auth_opts():
|
|
||||||
opt_list = copy.deepcopy(_ironic_options)
|
|
||||||
opt_list.insert(0, ks_loading.get_auth_common_conf_options()[0])
|
|
||||||
# NOTE(mhickey): There are a lot of auth plugins, we just generate
|
|
||||||
# the config options for a few common ones
|
|
||||||
plugins = ['password', 'v2password', 'v3password']
|
|
||||||
for name in plugins:
|
|
||||||
for plugin_option in ks_loading.get_auth_plugin_conf_options(name):
|
|
||||||
if all(option.name != plugin_option.name for option in opt_list):
|
|
||||||
opt_list.append(plugin_option)
|
|
||||||
opt_list.sort(key=operator.attrgetter('name'))
|
|
||||||
return [(IRONIC_GROUP, opt_list)]
|
|
||||||
|
@ -161,7 +161,8 @@ oslo.config.opts =
|
|||||||
neutron.ml2.sriov.agent = neutron.opts:list_sriov_agent_opts
|
neutron.ml2.sriov.agent = neutron.opts:list_sriov_agent_opts
|
||||||
neutron.ml2.xenapi = neutron.opts:list_xenapi_opts
|
neutron.ml2.xenapi = neutron.opts:list_xenapi_opts
|
||||||
neutron.ovn.metadata.agent = neutron.conf.agent.ovn.metadata.config:list_metadata_agent_opts
|
neutron.ovn.metadata.agent = neutron.conf.agent.ovn.metadata.config:list_metadata_agent_opts
|
||||||
nova.auth = neutron.opts:list_auth_opts
|
nova.auth = neutron.opts:list_nova_auth_opts
|
||||||
|
placement.auth = neutron.opts:list_placement_auth_opts
|
||||||
oslo.config.opts.defaults =
|
oslo.config.opts.defaults =
|
||||||
neutron = neutron.common.config:set_config_defaults
|
neutron = neutron.common.config:set_config_defaults
|
||||||
oslo.policy.enforcer =
|
oslo.policy.enforcer =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user