From c463c6f50c5d1cf6277539626fe386f6d4df6355 Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi Date: Wed, 13 Sep 2017 13:12:16 +0200 Subject: [PATCH] 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 --- cinder/common/config.py | 30 ------------- cinder/compute/nova.py | 43 +------------------ cinder/opts.py | 1 - .../tests/unit/scheduler/test_host_filters.py | 2 - ...deprecated-nova-opts-b1ec66fe3a9bb3b9.yaml | 10 +++++ 5 files changed, 11 insertions(+), 75 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-nova-opts-b1ec66fe3a9bb3b9.yaml diff --git a/cinder/common/config.py b/cinder/common/config.py index 131fb01e2e2..9684154f9c9 100644 --- a/cinder/common/config.py +++ b/cinder/common/config.py @@ -173,36 +173,6 @@ global_opts = [ cfg.StrOpt('group_api_class', default='cinder.group.api.API', 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) diff --git a/cinder/compute/nova.py b/cinder/compute/nova.py index 43274df73b4..7a014d7c38f 100644 --- a/cinder/compute/nova.py +++ b/cinder/compute/nova.py @@ -28,27 +28,6 @@ from requests import exceptions as request_exceptions from cinder.db import base 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: ' - '::', - 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 = [ cfg.StrOpt('region_name', help='Name of nova region to use. Useful if keystone manages ' @@ -70,13 +49,9 @@ nova_opts = [ NOVA_GROUP = 'nova' CONF = cfg.CONF -deprecations = {'cafile': [cfg.DeprecatedOpt('nova_ca_certificates_file')], - 'insecure': [cfg.DeprecatedOpt('nova_api_insecure')]} -nova_session_opts = ks_loading.get_session_conf_options( - deprecated_opts=deprecations) +nova_session_opts = ks_loading.get_session_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_session_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: LOG.debug('Creating Keystone auth plugin from conf') 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: if CONF[NOVA_GROUP].token_auth_url: url = CONF[NOVA_GROUP].token_auth_url diff --git a/cinder/opts.py b/cinder/opts.py index d5a55532c99..a031dd61bfb 100644 --- a/cinder/opts.py +++ b/cinder/opts.py @@ -235,7 +235,6 @@ def list_opts(): cinder_common_config.core_opts, cinder_common_config.global_opts, cinder.compute.compute_opts, - cinder_compute_nova.old_opts, cinder_context.context_opts, cinder_db_api.db_opts, [cinder_db_base.db_driver_opt], diff --git a/cinder/tests/unit/scheduler/test_host_filters.py b/cinder/tests/unit/scheduler/test_host_filters.py index 63a29a3beed..9518caff1d9 100644 --- a/cinder/tests/unit/scheduler/test_host_filters.py +++ b/cinder/tests/unit/scheduler/test_host_filters.py @@ -1012,8 +1012,6 @@ class DriverFilterTestCase(BackendFiltersTestCase): class InstanceLocalityFilterTestCase(BackendFiltersTestCase): def setUp(self): super(InstanceLocalityFilterTestCase, self).setUp() - self.override_config('nova_endpoint_template', - 'http://novahost:8774/v2/%(project_id)s') self.context.service_catalog = \ [{'type': 'compute', 'name': 'nova', 'endpoints': [{'publicURL': 'http://novahost:8774/v2/e3f0833dc08b4cea'}]}, diff --git a/releasenotes/notes/remove-deprecated-nova-opts-b1ec66fe3a9bb3b9.yaml b/releasenotes/notes/remove-deprecated-nova-opts-b1ec66fe3a9bb3b9.yaml new file mode 100644 index 00000000000..e022bc200dd --- /dev/null +++ b/releasenotes/notes/remove-deprecated-nova-opts-b1ec66fe3a9bb3b9.yaml @@ -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.