Deprecate barbican options
1. Deprecating barbican options as these are moved to Castellan library. 2. Added new formatting Blueprint centralize-config-options-newton Change-Id: Ic8bd86e2652b7702c039ea1d2e15a7bf5a2a9586
This commit is contained in:
@@ -1,10 +1,3 @@
|
|||||||
# needs:fix_opt_description
|
|
||||||
# needs:check_deprecation_status
|
|
||||||
# needs:check_opt_group_and_type
|
|
||||||
# needs:fix_opt_description_indentation
|
|
||||||
# needs:fix_opt_registration_consistency
|
|
||||||
|
|
||||||
|
|
||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
@@ -19,35 +12,72 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from castellan import options as castellan_opts
|
||||||
from keystoneauth1 import loading as ks_loading
|
from keystoneauth1 import loading as ks_loading
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
# All barbican related code and options have been moved to
|
||||||
|
# a separate library the Castellan. Deprecating these option for
|
||||||
|
# Newton. These will be deleted post Newton
|
||||||
|
|
||||||
barbican_group = cfg.OptGroup(
|
barbican_group = cfg.OptGroup(
|
||||||
'barbican',
|
"barbican",
|
||||||
title='Barbican options')
|
title="Barbican options")
|
||||||
|
|
||||||
barbican_opts = [
|
barbican_opts = [
|
||||||
cfg.StrOpt('catalog_info',
|
cfg.StrOpt("catalog_info",
|
||||||
default='key-manager:barbican:public',
|
default="key-manager:barbican:public",
|
||||||
help='Info to match when looking for barbican in the service '
|
deprecated_for_removal=True,
|
||||||
'catalog. Format is: separated values of the form: '
|
deprecated_reason="This option have been moved to the "
|
||||||
'<service_type>:<service_name>:<endpoint_type>'),
|
"Castellan library",
|
||||||
cfg.StrOpt('endpoint_template',
|
help="""
|
||||||
help='Override service catalog lookup with template for '
|
Info to match when looking for barbican in the service
|
||||||
'barbican endpoint e.g. '
|
catalog. Format is: separated values of the form:
|
||||||
'http://localhost:9311/v1/%(project_id)s'),
|
<service_type>:<service_name>:<endpoint_type>
|
||||||
cfg.StrOpt('os_region_name',
|
"""),
|
||||||
help='Region name of this node'),
|
cfg.StrOpt("endpoint_template",
|
||||||
|
deprecated_for_removal=True,
|
||||||
|
deprecated_reason="This option have been moved to the "
|
||||||
|
"Castellan library",
|
||||||
|
help="""
|
||||||
|
Override service catalog lookup with template for
|
||||||
|
barbican endpoint e.g.
|
||||||
|
http://localhost:9311/v1/%(project_id)s
|
||||||
|
"""),
|
||||||
|
cfg.StrOpt("os_region_name",
|
||||||
|
deprecated_for_removal=True,
|
||||||
|
deprecated_reason="This option have been moved to the "
|
||||||
|
"Castellan library",
|
||||||
|
help="""
|
||||||
|
Region name of this node
|
||||||
|
"""),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
|
castellan_opts.set_defaults(conf)
|
||||||
|
# TODO(raj_singh): Code block below is deprecated and will be removed
|
||||||
|
# post Newton
|
||||||
conf.register_group(barbican_group)
|
conf.register_group(barbican_group)
|
||||||
conf.register_opts(barbican_opts, group=barbican_group)
|
conf.register_opts(barbican_opts, group=barbican_group)
|
||||||
ks_loading.register_session_conf_options(conf, barbican_group.name)
|
ks_loading.register_session_conf_options(conf, barbican_group.name)
|
||||||
|
|
||||||
|
|
||||||
def list_opts():
|
def list_opts():
|
||||||
return {
|
# Castellan library also has a group name barbican. So if we append
|
||||||
barbican_group.name: barbican_opts
|
# list returned from barbican to this list, oslo will remove one group as
|
||||||
}
|
# duplicate and only one group (either from this file or Castellan library)
|
||||||
|
# will show up.
|
||||||
|
# So fix is to merge options of this file to "barbican" group returned from
|
||||||
|
# Castellan
|
||||||
|
opts = {barbican_group.name: barbican_opts}
|
||||||
|
for group, options in castellan_opts.list_opts():
|
||||||
|
if group not in opts.keys():
|
||||||
|
opts[group] = options
|
||||||
|
else:
|
||||||
|
opts[group] = opts[group] + options
|
||||||
|
return opts
|
||||||
|
# TODO(raj_singh): Post Newton delete code block from above and comment in
|
||||||
|
# line below. Castellan already returned a list which can be returned
|
||||||
|
# directly from list_opts()
|
||||||
|
# return castellan_opts.list_opts()
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
from castellan import options as castellan_opts
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
@@ -26,8 +25,6 @@ LOG = logging.getLogger(__name__)
|
|||||||
CONF = nova.conf.CONF
|
CONF = nova.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
castellan_opts.set_defaults(CONF)
|
|
||||||
|
|
||||||
# NOTE(kfarr): This line can be removed when a value is assigned in DevStack
|
# NOTE(kfarr): This line can be removed when a value is assigned in DevStack
|
||||||
CONF.set_default('api_class', 'nova.keymgr.conf_key_mgr.ConfKeyManager',
|
CONF.set_default('api_class', 'nova.keymgr.conf_key_mgr.ConfKeyManager',
|
||||||
group='key_manager')
|
group='key_manager')
|
||||||
|
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- All barbican config options in Nova are now
|
||||||
|
deprecated and may be removed as early as 15.0.0
|
||||||
|
release. All of these options are moved to the
|
||||||
|
Castellan library.
|
Reference in New Issue
Block a user