Remove deprecated nova config options

In Pike, the nova client converted to use the [nova] section.
Remove the obsolete config options now.

Change-Id: Ic112a68101c0dcb14da0db06c62ae190474a37d9
This commit is contained in:
Gyorgy Szombathelyi 2017-09-13 13:12:16 +02:00
parent 7552648b1b
commit c463c6f50c
5 changed files with 11 additions and 75 deletions

View File

@ -173,36 +173,6 @@ global_opts = [
cfg.StrOpt('group_api_class', cfg.StrOpt('group_api_class',
default='cinder.group.api.API', default='cinder.group.api.API',
help='The full class name of the group API class'), help='The full class name of the group API class'),
cfg.StrOpt('os_privileged_user_name',
help='OpenStack privileged account username. Used for requests '
'to other services (such as Nova) that require an account '
'with special rights.',
deprecated_for_removal=True,
deprecated_since="11.0.0",
deprecated_reason='Use the [nova] section for configuring '
'Keystone authentication for a privileged user.'),
cfg.StrOpt('os_privileged_user_password',
help='Password associated with the OpenStack privileged '
'account.',
deprecated_for_removal=True,
deprecated_since="11.0.0",
deprecated_reason='Use the [nova] section to configure '
'Keystone authentication for a privileged user.',
secret=True),
cfg.StrOpt('os_privileged_user_tenant',
help='Tenant name associated with the OpenStack privileged '
'account.',
deprecated_for_removal=True,
deprecated_since="11.0.0",
deprecated_reason='Use the [nova] section to configure '
'Keystone authentication for a privileged user.'),
cfg.URIOpt('os_privileged_user_auth_url',
help='Auth URL associated with the OpenStack privileged '
'account.',
deprecated_for_removal=True,
deprecated_since="11.0.0",
deprecated_reason='Use the [nova] section to configure '
'Keystone authentication for a privileged user.')
] ]
CONF.register_opts(core_opts) CONF.register_opts(core_opts)

View File

@ -28,27 +28,6 @@ from requests import exceptions as request_exceptions
from cinder.db import base from cinder.db import base
from cinder import exception from cinder import exception
old_opts = [
cfg.StrOpt('nova_catalog_info',
default='compute:Compute Service:publicURL',
help='Match this value when searching for nova in the '
'service catalog. Format is: separated values of '
'the form: '
'<service_type>:<service_name>:<endpoint_type>',
deprecated_for_removal=True),
cfg.StrOpt('nova_catalog_admin_info',
default='compute:Compute Service:publicURL',
help='Same as nova_catalog_info, but for admin endpoint.',
deprecated_for_removal=True),
cfg.StrOpt('nova_endpoint_template',
help='Override service catalog lookup with template for nova '
'endpoint e.g. http://localhost:8774/v2/%(project_id)s',
deprecated_for_removal=True),
cfg.StrOpt('nova_endpoint_admin_template',
help='Same as nova_endpoint_template, but for admin endpoint.',
deprecated_for_removal=True),
]
nova_opts = [ nova_opts = [
cfg.StrOpt('region_name', cfg.StrOpt('region_name',
help='Name of nova region to use. Useful if keystone manages ' help='Name of nova region to use. Useful if keystone manages '
@ -70,13 +49,9 @@ nova_opts = [
NOVA_GROUP = 'nova' NOVA_GROUP = 'nova'
CONF = cfg.CONF CONF = cfg.CONF
deprecations = {'cafile': [cfg.DeprecatedOpt('nova_ca_certificates_file')], nova_session_opts = ks_loading.get_session_conf_options()
'insecure': [cfg.DeprecatedOpt('nova_api_insecure')]}
nova_session_opts = ks_loading.get_session_conf_options(
deprecated_opts=deprecations)
nova_auth_opts = ks_loading.get_auth_common_conf_options() nova_auth_opts = ks_loading.get_auth_common_conf_options()
CONF.register_opts(old_opts)
CONF.register_opts(nova_opts, group=NOVA_GROUP) CONF.register_opts(nova_opts, group=NOVA_GROUP)
CONF.register_opts(nova_session_opts, group=NOVA_GROUP) CONF.register_opts(nova_session_opts, group=NOVA_GROUP)
CONF.register_opts(nova_auth_opts, group=NOVA_GROUP) CONF.register_opts(nova_auth_opts, group=NOVA_GROUP)
@ -121,22 +96,6 @@ def novaclient(context, privileged_user=False, timeout=None, api_version=None):
if privileged_user and CONF[NOVA_GROUP].auth_type: if privileged_user and CONF[NOVA_GROUP].auth_type:
LOG.debug('Creating Keystone auth plugin from conf') LOG.debug('Creating Keystone auth plugin from conf')
n_auth = ks_loading.load_auth_from_conf_options(CONF, NOVA_GROUP) n_auth = ks_loading.load_auth_from_conf_options(CONF, NOVA_GROUP)
elif privileged_user and CONF.os_privileged_user_name:
# Fall back to the deprecated os_privileged_xxx settings.
# TODO(gyurco): Remove it after Pike.
if CONF.os_privileged_user_auth_url:
url = CONF.os_privileged_user_auth_url
else:
url = _get_identity_endpoint_from_sc(context)
LOG.debug('Creating Keystone password plugin from legacy settings '
'using URL: %s', url)
n_auth = identity.Password(
auth_url=url,
username=CONF.os_privileged_user_name,
password=CONF.os_privileged_user_password,
project_name=CONF.os_privileged_user_tenant,
project_domain_id=context.project_domain,
user_domain_id=context.user_domain)
else: else:
if CONF[NOVA_GROUP].token_auth_url: if CONF[NOVA_GROUP].token_auth_url:
url = CONF[NOVA_GROUP].token_auth_url url = CONF[NOVA_GROUP].token_auth_url

View File

@ -235,7 +235,6 @@ def list_opts():
cinder_common_config.core_opts, cinder_common_config.core_opts,
cinder_common_config.global_opts, cinder_common_config.global_opts,
cinder.compute.compute_opts, cinder.compute.compute_opts,
cinder_compute_nova.old_opts,
cinder_context.context_opts, cinder_context.context_opts,
cinder_db_api.db_opts, cinder_db_api.db_opts,
[cinder_db_base.db_driver_opt], [cinder_db_base.db_driver_opt],

View File

@ -1012,8 +1012,6 @@ class DriverFilterTestCase(BackendFiltersTestCase):
class InstanceLocalityFilterTestCase(BackendFiltersTestCase): class InstanceLocalityFilterTestCase(BackendFiltersTestCase):
def setUp(self): def setUp(self):
super(InstanceLocalityFilterTestCase, self).setUp() super(InstanceLocalityFilterTestCase, self).setUp()
self.override_config('nova_endpoint_template',
'http://novahost:8774/v2/%(project_id)s')
self.context.service_catalog = \ self.context.service_catalog = \
[{'type': 'compute', 'name': 'nova', 'endpoints': [{'type': 'compute', 'name': 'nova', 'endpoints':
[{'publicURL': 'http://novahost:8774/v2/e3f0833dc08b4cea'}]}, [{'publicURL': 'http://novahost:8774/v2/e3f0833dc08b4cea'}]},

View File

@ -0,0 +1,10 @@
---
upgrade:
- Removed the deprecated options for the Nova connection:>
os_privileged_user{name, password, tenant, auth_url},
nova_catalog_info, nova_catalog_admin_info,
nova_endpoint_template, nova_endpoint_admin_template,
nova_ca_certificates_file, nova_api_insecure.
From Pike, using the [nova] section is preferred to
configure compute connection for Guest Assisted Snapshost
or the InstanceLocalityFilter.