Remove [keystone] config options from placement
Similar to I180a4df89d8338dc640dc2c5638775c65bde1cb7, this removes the entire [keystone] group from placement.conf since placement does not use it. The [keystone] group from nova.conf was optionally used by a couple of compute APIs for validating a user-provided project ID (flavor access and quota APIs). Since placement doesn't use the options, they are removed here so we don't have to go through a formal deprecation period after placement is officially released. The placement/conf/utils.py module is also not used so it is removed as well. While doing this, it was noticed that the [keystone_authtoken] options, which *are* used by placement.auth.PlacementAuthProtocol for the auth token middleware, were missing from the generated placement config docs, so that's fixed in this change as well. Change-Id: Ic856a4a43a21fbae3fe98466d1dc716d2736d622
This commit is contained in:
parent
685b3eff43
commit
85723b89a4
|
@ -2,3 +2,6 @@
|
|||
output_file = etc/placement/placement.conf.sample
|
||||
wrap_width = 80
|
||||
namespace = placement.conf
|
||||
namespace = keystonemiddleware.auth_token
|
||||
# FIXME(mriedem): There are likely other missing 3rd party oslo library
|
||||
# options that should show up in the placement.conf docs, like oslo.policy.
|
||||
|
|
|
@ -19,7 +19,6 @@ from oslo_config import cfg
|
|||
from placement.conf import api
|
||||
from placement.conf import base
|
||||
from placement.conf import database
|
||||
from placement.conf import keystone
|
||||
from placement.conf import paths
|
||||
from placement.conf import placement
|
||||
|
||||
|
@ -28,6 +27,5 @@ CONF = cfg.CONF
|
|||
api.register_opts(CONF)
|
||||
base.register_opts(CONF)
|
||||
database.register_opts(CONF)
|
||||
keystone.register_opts(CONF)
|
||||
paths.register_opts(CONF)
|
||||
placement.register_opts(CONF)
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from __future__ import absolute_import
|
||||
|
||||
from keystoneauth1 import loading as ks_loading
|
||||
from oslo_config import cfg
|
||||
|
||||
from placement.conf import utils as confutils
|
||||
|
||||
|
||||
DEFAULT_SERVICE_TYPE = 'identity'
|
||||
|
||||
keystone_group = cfg.OptGroup(
|
||||
'keystone',
|
||||
title='Keystone Options',
|
||||
help='Configuration options for the identity service')
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_group(keystone_group)
|
||||
confutils.register_ksa_opts(conf, keystone_group.name,
|
||||
DEFAULT_SERVICE_TYPE, include_auth=False)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return {
|
||||
keystone_group: (
|
||||
ks_loading.get_session_conf_options() +
|
||||
confutils.get_ksa_adapter_opts(DEFAULT_SERVICE_TYPE)
|
||||
)
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
# Copyright 2017 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Common utilities for conf providers.
|
||||
|
||||
This module does not provide any actual conf options.
|
||||
"""
|
||||
from keystoneauth1 import loading as ks_loading
|
||||
from oslo_config import cfg
|
||||
|
||||
|
||||
_ADAPTER_VERSION_OPTS = ('version', 'min_version', 'max_version')
|
||||
|
||||
|
||||
def get_ksa_adapter_opts(default_service_type, deprecated_opts=None):
|
||||
"""Get auth, Session, and Adapter conf options from keystoneauth1.loading.
|
||||
|
||||
:param default_service_type: Default for the service_type conf option on
|
||||
the Adapter.
|
||||
:param deprecated_opts: dict of deprecated opts to register with the ksa
|
||||
Adapter opts. Works the same as the
|
||||
deprecated_opts kwarg to:
|
||||
keystoneauth1.loading.session.Session.register_conf_options
|
||||
:return: List of cfg.Opts.
|
||||
"""
|
||||
opts = ks_loading.get_adapter_conf_options(include_deprecated=False,
|
||||
deprecated_opts=deprecated_opts)
|
||||
|
||||
for opt in opts[:]:
|
||||
# Remove version-related opts. Required/supported versions are
|
||||
# something the code knows about, not the operator.
|
||||
if opt.dest in _ADAPTER_VERSION_OPTS:
|
||||
opts.remove(opt)
|
||||
|
||||
# Override defaults that make sense for nova
|
||||
cfg.set_defaults(opts,
|
||||
valid_interfaces=['internal', 'public'],
|
||||
service_type=default_service_type)
|
||||
return opts
|
||||
|
||||
|
||||
def _dummy_opt(name):
|
||||
# A config option that can't be set by the user, so it behaves as if it's
|
||||
# ignored; but consuming code may expect it to be present in a conf group.
|
||||
return cfg.Opt(name, type=lambda x: None)
|
||||
|
||||
|
||||
def register_ksa_opts(conf, group, default_service_type, include_auth=True,
|
||||
deprecated_opts=None):
|
||||
"""Register keystoneauth auth, Session, and Adapter opts.
|
||||
|
||||
:param conf: oslo_config.cfg.CONF in which to register the options
|
||||
:param group: Conf group, or string name thereof, in which to register the
|
||||
options.
|
||||
:param default_service_type: Default for the service_type conf option on
|
||||
the Adapter.
|
||||
:param include_auth: For service types where Nova is acting on behalf of
|
||||
the user, auth should come from the user context.
|
||||
In those cases, set this arg to False to avoid
|
||||
registering ksa auth options.
|
||||
:param deprecated_opts: dict of deprecated opts to register with the ksa
|
||||
Session or Adapter opts. See docstring for
|
||||
the deprecated_opts param of:
|
||||
keystoneauth1.loading.session.Session.register_conf_options
|
||||
"""
|
||||
# ksa register methods need the group name as a string. oslo doesn't care.
|
||||
group = getattr(group, 'name', group)
|
||||
ks_loading.register_session_conf_options(
|
||||
conf, group, deprecated_opts=deprecated_opts)
|
||||
if include_auth:
|
||||
ks_loading.register_auth_conf_options(conf, group)
|
||||
conf.register_opts(get_ksa_adapter_opts(
|
||||
default_service_type, deprecated_opts=deprecated_opts), group=group)
|
||||
# Have to register dummies for the version-related opts we removed
|
||||
for name in _ADAPTER_VERSION_OPTS:
|
||||
conf.register_opt(_dummy_opt(name), group=group)
|
||||
|
||||
|
||||
# NOTE(efried): Required for docs build.
|
||||
def list_opts():
|
||||
return {}
|
Loading…
Reference in New Issue