From 6360fe11752ec88ca39d5ce27b76384eb00e7f50 Mon Sep 17 00:00:00 2001 From: Eric Fried Date: Thu, 29 Mar 2018 10:27:30 -0500 Subject: Fix N332 api_version decorator hacking check We spuriously ran afoul of N332 here [1]. This change set fixes the hacking check to be a little narrower and avoid (at least some) false positives. [1] https://review.openstack.org/#/c/557508/1/nova/tests/unit/volume/test_cinder.py@1014 Change-Id: I8c5e0854141d7c329483d00d26de7078dc756ee0 --- nova/hacking/checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/hacking') diff --git a/nova/hacking/checks.py b/nova/hacking/checks.py index 9f5c747142..eea0a775e6 100644 --- a/nova/hacking/checks.py +++ b/nova/hacking/checks.py @@ -85,7 +85,7 @@ import_translation_for_log_or_exception = re.compile( r"(.)*(from\snova.i18n\simport)\s_") # We need this for cases where they have created their own _ function. custom_underscore_check = re.compile(r"(.)*_\s*=\s*(.)*") -api_version_re = re.compile(r"@.*api_version") +api_version_re = re.compile(r"@.*\bapi_version\b") dict_constructor_with_list_copy_re = re.compile(r".*\bdict\((\[)?(\(|\[)") decorator_re = re.compile(r"@.*") http_not_implemented_re = re.compile(r"raise .*HTTPNotImplemented\(") -- cgit v1.2.1