diff --git a/HACKING.rst b/HACKING.rst index dd79c55513f..256467d2616 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -15,7 +15,6 @@ Cinder Specific Commandments - [N328] LOG.info messages require translations `_LI()`. - [N329] LOG.exception and LOG.error messages require translations `_LE()`. - [N330] LOG.warning messages require translations `_LW()`. -- [N333] Ensure that oslo namespaces are used for namespaced libraries. - [N336] Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs. - [C301] timeutils.utcnow() from oslo_utils should be used instead of datetime.now(). - [C302] six.text_type should be used instead of unicode. diff --git a/cinder/hacking/checks.py b/cinder/hacking/checks.py index f794f83976b..73033af7ea9 100644 --- a/cinder/hacking/checks.py +++ b/cinder/hacking/checks.py @@ -383,14 +383,6 @@ def validate_log_translations(logical_line, filename): yield (0, msg) -def check_oslo_namespace_imports(logical_line): - if re.match(oslo_namespace_imports, logical_line): - msg = ("N333: '%s' must be used instead of '%s'.") % ( - logical_line.replace('oslo.', 'oslo_'), - logical_line) - yield(0, msg) - - def check_datetime_now(logical_line, noqa): if noqa: return @@ -500,7 +492,6 @@ def factory(register): register(CheckForStrUnicodeExc) register(CheckLoggingFormatArgs) register(CheckOptRegistrationArgs) - register(check_oslo_namespace_imports) register(check_datetime_now) register(check_timeutils_strtime) register(check_timeutils_isotime) diff --git a/cinder/tests/unit/test_hacking.py b/cinder/tests/unit/test_hacking.py index a118ea5b62d..ddd75fa4561 100644 --- a/cinder/tests/unit/test_hacking.py +++ b/cinder/tests/unit/test_hacking.py @@ -294,32 +294,6 @@ class HackingTestCase(test.TestCase): self.assertEqual(1, len(list(checks.no_mutable_default_args( "def foo (bar={}):")))) - def test_oslo_namespace_imports_check(self): - self.assertEqual(1, len(list(checks.check_oslo_namespace_imports( - "from oslo.concurrency import foo")))) - self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( - "from oslo_concurrency import bar")))) - self.assertEqual(1, len(list(checks.check_oslo_namespace_imports( - "from oslo.db import foo")))) - self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( - "from oslo_db import bar")))) - self.assertEqual(1, len(list(checks.check_oslo_namespace_imports( - "from oslo.config import foo")))) - self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( - "from oslo_config import bar")))) - self.assertEqual(1, len(list(checks.check_oslo_namespace_imports( - "from oslo.utils import foo")))) - self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( - "from oslo_utils import bar")))) - self.assertEqual(1, len(list(checks.check_oslo_namespace_imports( - "from oslo.serialization import foo")))) - self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( - "from oslo_serialization import bar")))) - self.assertEqual(1, len(list(checks.check_oslo_namespace_imports( - "from oslo.log import foo")))) - self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( - "from oslo_log import bar")))) - def test_check_datetime_now(self): self.assertEqual(1, len(list(checks.check_datetime_now( "datetime.now", False))))