Deprecate osapi_volume_base_url duplicate option

This option duplicates what public_endpoint does.

Change-Id: I2a74af7906d14cbc49b8cf0a88c344ca30fcbd26
This commit is contained in:
Mike Perez 2017-05-05 08:57:13 -07:00
parent e3a5ca62d1
commit 811395c645
3 changed files with 15 additions and 7 deletions

View File

@ -37,9 +37,11 @@ api_common_opts = [
help='The maximum number of items that a collection '
'resource returns in a single response'),
cfg.StrOpt('osapi_volume_base_URL',
help='Base URL that will be presented to users in links '
'to the OpenStack Volume API',
deprecated_name='osapi_compute_link_prefix'),
help='DEPRECATED: Base URL that will be presented to users in '
'links to the OpenStack Volume API',
deprecated_name='osapi_compute_link_prefix',
deprecated_since='Pike',
deprecated_reason='Duplicate config option.'),
cfg.StrOpt('resource_query_filters_file',
default='/etc/cinder/resource_filters.json',
help="Json file indicating user visible filter "
@ -59,6 +61,7 @@ api_common_opts = [
]
CONF = cfg.CONF
CONF.import_opt('public_endpoint', 'cinder.api.views.versions')
CONF.register_opts(api_common_opts)
LOG = logging.getLogger(__name__)
@ -297,7 +300,7 @@ class ViewBuilder(object):
params = request.params.copy()
params["marker"] = identifier
prefix = self._update_link_prefix(get_request_url(request),
CONF.osapi_volume_base_URL)
CONF.public_endpoint)
url = os.path.join(prefix,
request.environ["cinder.context"].project_id,
collection_name)
@ -306,7 +309,7 @@ class ViewBuilder(object):
def _get_href_link(self, request, identifier):
"""Return an href string pointing to this object."""
prefix = self._update_link_prefix(get_request_url(request),
CONF.osapi_volume_base_URL)
CONF.public_endpoint)
return os.path.join(prefix,
request.environ["cinder.context"].project_id,
self._collection_name,
@ -316,7 +319,7 @@ class ViewBuilder(object):
"""Create a URL that refers to a specific resource."""
base_url = remove_version_from_href(get_request_url(request))
base_url = self._update_link_prefix(base_url,
CONF.osapi_volume_base_URL)
CONF.public_endpoint)
return os.path.join(base_url,
request.environ["cinder.context"].project_id,
self._collection_name,

View File

@ -27,7 +27,8 @@ versions_opts = [
"is None, which will use the request's host_url "
"attribute to populate the URL base. If Cinder is "
"operating behind a proxy, you will want to change "
"this to represent the proxy's URL."),
"this to represent the proxy's URL.",
deprecated_name='osapi_volume_base_URL'),
]
CONF = cfg.CONF

View File

@ -0,0 +1,4 @@
---
deprecations:
- Instead of using osapi_volume_base_url use public_endpoint. Both do the
same thing.