diff --git a/HACKING.rst b/HACKING.rst index a662ff12c..8e896cbcc 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -9,7 +9,6 @@ Neutron Library Specific Commandments ------------------------------------- - [N521] Validate that jsonutils module is used instead of json -- [N523] DEPRECATED. Enforce namespace-less imports for oslo libraries - [N524] Prevent use of deprecated contextlib.nested. - [N525] Python 3: Do not use xrange. - [N526] Python 3: do not use basestring. diff --git a/neutron_lib/hacking/checks.py b/neutron_lib/hacking/checks.py index 0582b1b0d..6b013328b 100644 --- a/neutron_lib/hacking/checks.py +++ b/neutron_lib/hacking/checks.py @@ -14,8 +14,6 @@ import re -from debtcollector import removals - from neutron_lib.hacking import translation_checks # Guidelines for writing new hacking checks @@ -107,21 +105,6 @@ def _check_namespace_imports(failure_code, namespace, new_ns, logical_line, return (0, msg_o or msg) -@removals.remove(removal_version='P release') -def check_oslo_namespace_imports(logical_line): - """N523 - Import oslo_ rather than oslo. - - :param logical_line: The logical line to check. - :param filename: The file name where the logical line exists. - :returns: None if the logical line passes the check, otherwise a tuple - is yielded that contains the offending index in logical line and a - message describe the check validation failure. - """ - x = _check_namespace_imports('N523', 'oslo', 'oslo_', logical_line) - if x is not None: - yield x - - def check_no_contextlib_nested(logical_line, filename): """N524 - Use of contextlib.nested is deprecated. diff --git a/neutron_lib/tests/unit/hacking/test_checks.py b/neutron_lib/tests/unit/hacking/test_checks.py index 0052f5557..53acfba9f 100644 --- a/neutron_lib/tests/unit/hacking/test_checks.py +++ b/neutron_lib/tests/unit/hacking/test_checks.py @@ -80,14 +80,6 @@ class HackingTestCase(base.BaseTestCase): "./neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/" "etc/xapi.d/plugins/netwrap")))) - def test_check_oslo_namespace_imports(self): - f = checks.check_oslo_namespace_imports - self.assertLinePasses(f, 'from oslo_utils import importutils') - self.assertLinePasses(f, 'import oslo_messaging') - self.assertLineFails(f, 'from oslo.utils import importutils') - self.assertLineFails(f, 'from oslo import messaging') - self.assertLineFails(f, 'import oslo.messaging') - def test_check_contextlib_nested(self): f = checks.check_no_contextlib_nested self.assertLineFails(f, 'with contextlib.nested():', '') diff --git a/releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml b/releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml new file mode 100644 index 000000000..4a44b878b --- /dev/null +++ b/releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml @@ -0,0 +1,4 @@ +--- +other: + - The deprecated ``N523`` hacking check that ensures proper oslo namespace + imports has been removed.