From b0e56ac6466c80a9d7aa054361f2fb022198b9a3 Mon Sep 17 00:00:00 2001 From: Henry Gessau Date: Sat, 5 Nov 2016 21:29:41 -0400 Subject: [PATCH] Retire deprecations for constants, exceptions, attributes Subprojects have had enough time to switch to neutron-lib for the deprecated items from these modules. Change-Id: Ib2f4acf7e0153667389c57a52f2db33a23758b24 --- neutron/api/v2/attributes.py | 19 ------------------- neutron/common/constants.py | 8 -------- neutron/common/exceptions.py | 7 ------- .../drivers/iptables/iptables_driver.py | 2 +- neutron/tests/tempest/api/test_dhcp_ipv6.py | 2 +- tools/list_moved_globals.py | 9 +-------- 6 files changed, 3 insertions(+), 44 deletions(-) diff --git a/neutron/api/v2/attributes.py b/neutron/api/v2/attributes.py index 57b7bfe1a68..119bf98a3b1 100644 --- a/neutron/api/v2/attributes.py +++ b/neutron/api/v2/attributes.py @@ -20,14 +20,11 @@ import six import webob.exc from neutron._i18n import _ -from neutron.common import _deprecate # Defining a constant to avoid repeating string literal in several modules SHARED = 'shared' -_deprecate._moved_global('UNLIMITED', new_module=lib_validators) - # TODO(HenryG): use DB field sizes (neutron-lib 0.1.1) NAME_MAX_LEN = 255 TENANT_ID_MAX_LEN = 255 @@ -36,11 +33,6 @@ LONG_DESCRIPTION_MAX_LEN = 1024 DEVICE_ID_MAX_LEN = 255 DEVICE_OWNER_MAX_LEN = 255 -_deprecate._moved_global('MAC_PATTERN', new_module=lib_validators) - -_deprecate._moved_global('validators', new_module=lib_validators) - - # Define constants for base resource name NETWORK = 'network' NETWORKS = '%ss' % NETWORK @@ -433,14 +425,3 @@ def verify_attributes(res_dict, attr_info): if extra_keys: msg = _("Unrecognized attribute(s) '%s'") % ', '.join(extra_keys) raise webob.exc.HTTPBadRequest(msg) - - -# Shim added to move the following to neutron_lib.constants: -# ATTR_NOT_SPECIFIED -# HEX_ELEM -# UUID_PATTERN -# -# Neutron-lib migration shim. This will emit a deprecation warning on any -# reference to constants that have been moved out of this module and into -# the neutron_lib.constants module. -_deprecate._MovedGlobals(constants) diff --git a/neutron/common/constants.py b/neutron/common/constants.py index 759950f3ecb..74a2ff639a0 100644 --- a/neutron/common/constants.py +++ b/neutron/common/constants.py @@ -15,8 +15,6 @@ from neutron_lib import constants as lib_constants -from neutron.common import _deprecate - ROUTER_PORT_OWNERS = lib_constants.ROUTER_INTERFACE_OWNERS_SNAT + \ (lib_constants.DEVICE_OWNER_ROUTER_GW,) @@ -137,9 +135,3 @@ PRIVATE_CIDR_RANGE = '169.254.0.0/16' DVR_FIP_LL_CIDR = '169.254.64.0/18' L3_HA_NET_CIDR = '169.254.192.0/18' METADATA_CIDR = '169.254.169.254/32' - - -# Neutron-lib migration shim. This will emit a deprecation warning on any -# reference to constants that have been moved out of this module and into -# the neutron_lib.constants module. -_deprecate._MovedGlobals(lib_constants) diff --git a/neutron/common/exceptions.py b/neutron/common/exceptions.py index 88ae97b1c1e..a1ef235f8a8 100644 --- a/neutron/common/exceptions.py +++ b/neutron/common/exceptions.py @@ -16,7 +16,6 @@ from neutron_lib import exceptions as e from neutron._i18n import _ -from neutron.common import _deprecate class SubnetPoolNotFound(e.NotFound): @@ -310,9 +309,3 @@ class TenantQuotaNotFound(e.NotFound): class TenantIdProjectIdFilterConflict(e.BadRequest): message = _("Both tenant_id and project_id passed as filters.") - - -# Neutron-lib migration shim. This will emit a deprecation warning on any -# reference to exceptions that have been moved out of this module and into -# the neutron_lib.exceptions module. -_deprecate._MovedGlobals(e) diff --git a/neutron/services/metering/drivers/iptables/iptables_driver.py b/neutron/services/metering/drivers/iptables/iptables_driver.py index 003524c049f..8a3df4c5246 100644 --- a/neutron/services/metering/drivers/iptables/iptables_driver.py +++ b/neutron/services/metering/drivers/iptables/iptables_driver.py @@ -22,7 +22,7 @@ from neutron._i18n import _, _LE, _LI from neutron.agent.common import config from neutron.agent.linux import interface from neutron.agent.linux import iptables_manager -from neutron.common import constants as constants +from neutron.common import constants from neutron.common import ipv6_utils from neutron.services.metering.drivers import abstract_driver diff --git a/neutron/tests/tempest/api/test_dhcp_ipv6.py b/neutron/tests/tempest/api/test_dhcp_ipv6.py index e136efa7655..bf45825c0a8 100644 --- a/neutron/tests/tempest/api/test_dhcp_ipv6.py +++ b/neutron/tests/tempest/api/test_dhcp_ipv6.py @@ -14,10 +14,10 @@ # under the License. import netaddr +from neutron_lib import constants from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.common import constants from neutron.tests.tempest.api import base from neutron.tests.tempest import config diff --git a/tools/list_moved_globals.py b/tools/list_moved_globals.py index 46baa6eaf1d..26098e0fb50 100755 --- a/tools/list_moved_globals.py +++ b/tools/list_moved_globals.py @@ -18,12 +18,6 @@ Check for globals that are now available in neutron-lib from __future__ import print_function -from neutron_lib import constants as lconst -from neutron_lib import exceptions as lexc - -from neutron.common import constants as nconst -from neutron.common import exceptions as nexc - def check_globals(things, nmod, lmod): core = vars(nmod)['_mg__my_globals'] @@ -41,8 +35,7 @@ def check_globals(things, nmod, lmod): def main(): - check_globals('constants', nconst, lconst) - check_globals('exceptions', nexc, lexc) + """Currently no globals are deprecated.""" if __name__ == '__main__':