Fix ignored [neutron] options

The following three options have had no effect since implementation
to use these parameters were unintentionally removed by [1].
 - url
 - url_timeout
 - auth_strategy

This fixes/deprecates these parameters. The details are as follows.

1) url
This option is fixed and now overrides the endpoint url which Manila
uses to connect neutron. Default of the url option is changed to keep
the existing behavior by default.

2) url_timeout
This option is just deprecated, because there is already the timeout
parameter in keystoneauth to define request timeout.

3) auth_strategy
This option is also deprecated. The auth mechanism should be defined
by the auth_type parameter in keystoneauth instead.

[1] 7fc492ea79

Closes-Bug: #1946990
Change-Id: I34cfff78d70a5e1cbd2ee75da36b692cb19a45a4
This commit is contained in:
Takashi Kajinami 2021-10-13 23:00:49 +09:00
parent b7013c90e5
commit 2fd701e657
3 changed files with 26 additions and 1 deletions

View File

@ -31,14 +31,22 @@ NEUTRON_GROUP = 'neutron'
neutron_opts = [ neutron_opts = [
cfg.StrOpt( cfg.StrOpt(
'url', 'url',
default='http://127.0.0.1:9696',
help='URL for connecting to neutron.'), help='URL for connecting to neutron.'),
cfg.IntOpt( cfg.IntOpt(
'url_timeout', 'url_timeout',
deprecated_for_removal=True,
deprecated_reason='This parameter has had no effect since 2.0.0. '
'The timeout parameter should be used instead.',
deprecated_since='Yoga',
default=30, default=30,
help='Timeout value for connecting to neutron in seconds.'), help='Timeout value for connecting to neutron in seconds.'),
cfg.StrOpt( cfg.StrOpt(
'auth_strategy', 'auth_strategy',
deprecated_for_removal=True,
deprecated_reason='This parameter has had no effect since 2.0.0. '
'Use the auth_type parameter to select '
'authentication type',
deprecated_since='Yoga',
default='keystone', default='keystone',
help='Auth strategy for connecting to neutron in admin context.'), help='Auth strategy for connecting to neutron in admin context.'),
cfg.StrOpt( cfg.StrOpt(
@ -92,6 +100,7 @@ class API(object):
context, context,
endpoint_type=CONF[NEUTRON_GROUP].endpoint_type, endpoint_type=CONF[NEUTRON_GROUP].endpoint_type,
region_name=CONF[NEUTRON_GROUP].region_name, region_name=CONF[NEUTRON_GROUP].region_name,
endpoint_override=CONF[NEUTRON_GROUP].url,
) )
@property @property

View File

@ -90,6 +90,7 @@ class NeutronclientTestCase(test.TestCase):
fake_context = 'fake_context' fake_context = 'fake_context'
data = { data = {
'neutron': { 'neutron': {
'url': 'http://localhost:9696',
'endpoint_type': 'foo_endpoint_type', 'endpoint_type': 'foo_endpoint_type',
'region_name': 'foo_region_name', 'region_name': 'foo_region_name',
} }
@ -109,12 +110,14 @@ class NeutronclientTestCase(test.TestCase):
fake_context, fake_context,
endpoint_type=data['neutron']['endpoint_type'], endpoint_type=data['neutron']['endpoint_type'],
region_name=data['neutron']['region_name'], region_name=data['neutron']['region_name'],
endpoint_override=data['neutron']['url'],
) )
def test_with_auth_obj(self): def test_with_auth_obj(self):
fake_context = 'fake_context' fake_context = 'fake_context'
data = { data = {
'neutron': { 'neutron': {
'url': 'http://localhost:9696',
'endpoint_type': 'foo_endpoint_type', 'endpoint_type': 'foo_endpoint_type',
'region_name': 'foo_region_name', 'region_name': 'foo_region_name',
} }
@ -132,6 +135,7 @@ class NeutronclientTestCase(test.TestCase):
fake_context, fake_context,
endpoint_type=data['neutron']['endpoint_type'], endpoint_type=data['neutron']['endpoint_type'],
region_name=data['neutron']['region_name'], region_name=data['neutron']['region_name'],
endpoint_override=data['neutron']['url'],
) )

View File

@ -0,0 +1,12 @@
---
deprecations:
- |
The ``[neutron] url_timeout`` option and the ``[neutron] auth_strategy``
option have been deprecated and will be removed in a future release.
These two options have had no effect since 2.0.0 .
fixes:
- |
`Bug #1946990 <https://bugs.launchpad.net/manila/+bug/1946990>`_: Fix
the ignored ``[neutorn] url`` option. Now the parameter overrides
the endpoint url which Manila uses to access Neutron API.