From 26f008296bc11e927a58fe7bfe9b3ac6d1bb5365 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Thu, 22 Oct 2015 23:15:18 +0200 Subject: [PATCH] Remove deprecated nova_* options Neutron nova_* options have been deprecated in Kilo in favour of options in [nova] section. This change removes these options in order to simplify code, clarify configuration and avoid a warning in unittests. DocImpact UpgradeImpact Closes-Bug: #1509092 Related-Bug: #1403686 Change-Id: I950f72ad7d7d41cfa006f8c7105934301cd56faa --- etc/neutron.conf | 29 ---------------------------- neutron/common/config.py | 31 +----------------------------- neutron/notifiers/nova.py | 40 --------------------------------------- 3 files changed, 1 insertion(+), 99 deletions(-) diff --git a/etc/neutron.conf b/etc/neutron.conf index bac35bd2dc1..8c3d6068193 100644 --- a/etc/neutron.conf +++ b/etc/neutron.conf @@ -370,35 +370,6 @@ # so nova can update it's cache. # notify_nova_on_port_data_changes = True -# URL for connection to nova (Only supports one nova region currently). -# nova_url = http://127.0.0.1:8774/v2 - -# Name of nova region to use. Useful if keystone manages more than one region -# nova_region_name = - -# Username for connection to nova in admin context -# nova_admin_username = - -# The uuid of the admin nova tenant -# nova_admin_tenant_id = - -# The name of the admin nova tenant. If the uuid of the admin nova tenant -# is set, this is optional. Useful for cases where the uuid of the admin -# nova tenant is not available when configuration is being done. -# nova_admin_tenant_name = - -# Password for connection to nova in admin context. -# nova_admin_password = - -# Authorization URL for connection to nova in admin context. -# nova_admin_auth_url = - -# CA file for novaclient to verify server certificates -# nova_ca_certificates_file = - -# Boolean to control ignoring SSL errors on the nova url -# nova_api_insecure = False - # Number of seconds between sending events to nova if there are any events to send # send_events_interval = 2 diff --git a/neutron/common/config.py b/neutron/common/config.py index 9739732030f..6555c1cee95 100644 --- a/neutron/common/config.py +++ b/neutron/common/config.py @@ -104,28 +104,6 @@ core_opts = [ cfg.BoolOpt('notify_nova_on_port_data_changes', default=True, help=_("Send notification to nova when port data (fixed_ips/" "floatingip) changes so nova can update its cache.")), - cfg.StrOpt('nova_url', - default='http://127.0.0.1:8774/v2', - help=_('URL for connection to nova. ' - 'Deprecated in favour of an auth plugin in [nova].')), - cfg.StrOpt('nova_admin_username', - help=_('Username for connecting to nova in admin context. ' - 'Deprecated in favour of an auth plugin in [nova].')), - cfg.StrOpt('nova_admin_password', - help=_('Password for connection to nova in admin context. ' - 'Deprecated in favour of an auth plugin in [nova].'), - secret=True), - cfg.StrOpt('nova_admin_tenant_id', - help=_('The uuid of the admin nova tenant. ' - 'Deprecated in favour of an auth plugin in [nova].')), - cfg.StrOpt('nova_admin_tenant_name', - help=_('The name of the admin nova tenant. ' - 'Deprecated in favour of an auth plugin in [nova].')), - cfg.StrOpt('nova_admin_auth_url', - default='http://localhost:5000/v2.0', - help=_('Authorization URL for connecting to nova in admin ' - 'context. ' - 'Deprecated in favour of an auth plugin in [nova].')), cfg.IntOpt('send_events_interval', default=2, help=_('Number of seconds between sending events to nova if ' 'there are any events to send.')), @@ -169,18 +147,11 @@ set_db_defaults() NOVA_CONF_SECTION = 'nova' -nova_deprecated_opts = { - 'cafile': [cfg.DeprecatedOpt('nova_ca_certificates_file', 'DEFAULT')], - 'insecure': [cfg.DeprecatedOpt('nova_api_insecure', 'DEFAULT')], -} -ks_session.Session.register_conf_options(cfg.CONF, NOVA_CONF_SECTION, - deprecated_opts=nova_deprecated_opts) +ks_session.Session.register_conf_options(cfg.CONF, NOVA_CONF_SECTION) auth.register_conf_options(cfg.CONF, NOVA_CONF_SECTION) nova_opts = [ cfg.StrOpt('region_name', - deprecated_name='nova_region_name', - deprecated_group='DEFAULT', help=_('Name of nova region to use. Useful if keystone manages' ' more than one region.')), ] diff --git a/neutron/notifiers/nova.py b/neutron/notifiers/nova.py index 8fb81862c2f..adb6520c8b1 100644 --- a/neutron/notifiers/nova.py +++ b/neutron/notifiers/nova.py @@ -14,7 +14,6 @@ # under the License. from keystoneclient import auth as ks_auth -from keystoneclient.auth.identity import v2 as v2_auth from keystoneclient import session as ks_session from novaclient import client as nova_client from novaclient import exceptions as nova_exceptions @@ -41,27 +40,6 @@ NEUTRON_NOVA_EVENT_STATUS_MAP = {constants.PORT_STATUS_ACTIVE: 'completed', NOVA_API_VERSION = "2" -class DefaultAuthPlugin(v2_auth.Password): - """A wrapper around standard v2 user/pass to handle bypass url. - - This is only necessary because novaclient doesn't support endpoint_override - yet - bug #1403329. - - When this bug is fixed we can pass the endpoint_override to the client - instead and remove this class. - """ - - def __init__(self, **kwargs): - self._endpoint_override = kwargs.pop('endpoint_override', None) - super(DefaultAuthPlugin, self).__init__(**kwargs) - - def get_endpoint(self, session, **kwargs): - if self._endpoint_override: - return self._endpoint_override - - return super(DefaultAuthPlugin, self).get_endpoint(session, **kwargs) - - class Notifier(object): def __init__(self): @@ -70,24 +48,6 @@ class Notifier(object): # authenticating the exact same thing len(controllers) times. This # should be an easy thing to optimize. auth = ks_auth.load_from_conf_options(cfg.CONF, 'nova') - endpoint_override = None - - if not auth: - LOG.warning(_LW('Authenticating to nova using nova_admin_* options' - ' is deprecated. This should be done using' - ' an auth plugin, like password')) - - if cfg.CONF.nova_admin_tenant_id: - endpoint_override = "%s/%s" % (cfg.CONF.nova_url, - cfg.CONF.nova_admin_tenant_id) - - auth = DefaultAuthPlugin( - auth_url=cfg.CONF.nova_admin_auth_url, - username=cfg.CONF.nova_admin_username, - password=cfg.CONF.nova_admin_password, - tenant_id=cfg.CONF.nova_admin_tenant_id, - tenant_name=cfg.CONF.nova_admin_tenant_name, - endpoint_override=endpoint_override) session = ks_session.Session.load_from_conf_options(cfg.CONF, 'nova',