Remove H307 no db in virt

This is a Nova only rule that shouldn't be in the generic hacking tool

Change-Id: Ibdba7319a1bf08fb917aaac8503203a857f08b83
Reviewed-on: https://review.openstack.org/27090
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Doug Hellmann <doug.hellmann@dreamhost.com>
Reviewed-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Tested-by: Jenkins
This commit is contained in:
Joe Gordon 2013-04-17 16:11:41 -07:00 committed by Jenkins
parent 44135d136c
commit ec4833b206
3 changed files with 0 additions and 16 deletions

View File

@ -59,7 +59,6 @@ Imports
- Do not import more than one module per line (*)
- Do not use wildcard ``*`` import (*)
- Do not make relative imports
- Do not make new nova.db imports in nova/virt/*
- Order your imports by the full module path
- Organize your imports according to the following template

View File

@ -274,20 +274,6 @@ def hacking_import_alphabetical(logical_line, blank_lines, previous_logical,
% (split_previous[1], split_line[1]))
@flake8ext
def hacking_import_no_db_in_virt(logical_line, filename):
"""Check for db calls from nova/virt
As of grizzly-2 all the database calls have been removed from
nova/virt, and we want to keep it that way.
H307
"""
if "nova/virt" in filename and not filename.endswith("fake.py"):
if logical_line.startswith("from nova import db"):
yield (0, "H307: nova.db import not allowed in nova/virt/*")
def is_docstring(physical_line, previous_logical):
"""Return True if found docstring
'A docstring is a string literal that occurs as the first statement in a

View File

@ -31,7 +31,6 @@ flake8.extension =
H202 = hacking.core:hacking_except_format_assert
H301 = hacking.core:hacking_import_rules
H306 = hacking.core:hacking_import_alphabetical
H307 = hacking.core:hacking_import_no_db_in_virt
H401 = hacking.core:hacking_docstring_start_space
H402 = hacking.core:hacking_docstring_one_line
H403 = hacking.core:hacking_docstring_multiline_end