conf: remove deprecated barbican options

* removed deprecated barbican options
* fixed formatting in key_manager_opts list

Change-Id: Ia889084dc563c145e68390f75c53fac92b3f3ae6
Implements: blueprint centralize-config-options-ocata
This commit is contained in:
Maciej Szankin 2016-11-15 08:45:12 -06:00 committed by Sarafraj Singh
parent fb693f07f0
commit a63aef8fba
2 changed files with 17 additions and 46 deletions

View File

@ -14,7 +14,6 @@
# under the License. # under the License.
from castellan import options as castellan_opts from castellan import options as castellan_opts
from keystoneauth1 import loading as ks_loading
from oslo_config import cfg from oslo_config import cfg
key_manager_group = cfg.OptGroup( key_manager_group = cfg.OptGroup(
@ -22,6 +21,7 @@ key_manager_group = cfg.OptGroup(
title='Key manager options') title='Key manager options')
key_manager_opts = [ key_manager_opts = [
# TODO(raj_singh): Deprecate or move this option to The Castellan library
cfg.StrOpt( cfg.StrOpt(
'fixed_key', 'fixed_key',
deprecated_group='keymgr', deprecated_group='keymgr',
@ -34,67 +34,28 @@ Possible values:
"""), """),
] ]
barbican_group = cfg.OptGroup(
"barbican",
title="Barbican options")
barbican_opts = [
cfg.StrOpt("catalog_info",
default="key-manager:barbican:public",
deprecated_for_removal=True,
deprecated_since="14.0.0",
deprecated_reason="This option have been moved to the "
"Castellan library",
help="""
Info to match when looking for barbican in the service
catalog. Format is: separated values of the form:
<service_type>:<service_name>:<endpoint_type>
"""),
cfg.StrOpt("endpoint_template",
deprecated_for_removal=True,
deprecated_since="14.0.0",
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_since="14.0.0",
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) castellan_opts.set_defaults(conf)
conf.register_group(key_manager_group) conf.register_group(key_manager_group)
conf.register_opts(key_manager_opts, group=key_manager_group) conf.register_opts(key_manager_opts, group=key_manager_group)
# TODO(raj_singh): Todo: Code block below is deprecated and will be removed
# post Newton
conf.register_group(barbican_group)
conf.register_opts(barbican_opts, group=barbican_group)
ks_loading.register_session_conf_options(conf, barbican_group.name)
def list_opts(): def list_opts():
# Castellan library also has a group name barbican and key_manager. So if # Castellan library also has a group name key_manager. So if
# we append list returned from Castellan to this list, oslo will remove # we append list returned from Castellan to this list, oslo will remove
# one group as duplicate and only one group (either from this file or # 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 same # Castellan library) will show up. So fix is to merge options of same
# group name from this file and Castellan library # group name from this file and Castellan library
opts = {barbican_group.name: barbican_opts, opts = {key_manager_group.name: key_manager_opts}
key_manager_group.name: key_manager_opts}
for group, options in castellan_opts.list_opts(): for group, options in castellan_opts.list_opts():
if group not in opts.keys(): if group not in opts.keys():
opts[group] = options opts[group] = options
else: else:
opts[group] = opts[group] + options opts[group] = opts[group] + options
return opts return opts
# TODO(raj_singh): Post Newton delete code block from above and comment in # TODO(raj_singh): When the last option "fixed_key" is removed/moved from
# line below. Castellan already returned a list which can be returned # this file, then comment in code below and delete the code block above.
# Castellan already returned a list which can be returned
# directly from list_opts() # directly from list_opts()
# return castellan_opts.list_opts() # return castellan_opts.list_opts()

View File

@ -0,0 +1,10 @@
---
upgrade:
- |
Configuration options related to the Barbican were deprecated and now
completly removed from ``barbican`` group. These options are available in
the Castellan library. Following are the affected options:
- ``barbican.catalog_info``
- ``barbican.endpoint_template``
- ``barbican.os_region_name``