Ban db import from nova/virt

This makes hacking.py complain if someone adds something like:

  from nova import db

into any of the files in nova/virt/* (aside from the fake.py file).
It also removes the rest of the dangling db imports that are no
longer needed.

Yay!

Change-Id: Iba3d53b87e65e33a55f8e5033b5d1d33b28d12f7
This commit is contained in:
Dan Smith
2012-11-08 15:37:44 -08:00
parent e23be1aa22
commit 7208bbbc56

View File

@@ -271,6 +271,13 @@ def nova_import_alphabetical(logical_line, line_number, lines):
% (split_previous[1], split_line[1]))
def nova_import_no_db_in_virt(logical_line, filename):
if ("nova/virt" in filename and
not filename.endswith("fake.py") and
"nova import db" in logical_line):
yield (0, "NOVA N307: nova.db import not allowed in nova/virt/*")
def nova_docstring_start_space(physical_line):
"""Check for docstring not start with space.