diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-11-12 21:09:27 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-11-12 21:09:27 +0000 |
commit | e620fa9498267b2d2a68f8fab8c1f8bd944186a3 (patch) | |
tree | cd3e30d7030ef465a6b4d4e7eed723bc4914eaa0 | |
parent | 4818ac182ba30eb0c549a0506c0ead6ce34148cf (diff) | |
parent | 9471282626e004296351a4a97fb51209a53e7f42 (diff) | |
download | nova-e620fa9498267b2d2a68f8fab8c1f8bd944186a3.tar.gz nova-e620fa9498267b2d2a68f8fab8c1f8bd944186a3.tar.xz nova-e620fa9498267b2d2a68f8fab8c1f8bd944186a3.zip |
Merge "Ban db import from nova/virt"
-rw-r--r-- | HACKING.rst | 1 | ||||
-rw-r--r-- | nova/virt/hyperv/vmops.py | 1 | ||||
-rw-r--r-- | nova/virt/virtapi.py | 3 | ||||
-rw-r--r-- | nova/virt/xenapi/driver.py | 1 | ||||
-rw-r--r-- | nova/virt/xenapi/host.py | 1 | ||||
-rw-r--r-- | nova/virt/xenapi/pool.py | 1 | ||||
-rwxr-xr-x | tools/hacking.py | 7 |
7 files changed, 8 insertions, 7 deletions
diff --git a/HACKING.rst b/HACKING.rst index 52dc38bf8..bf8274cea 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -33,6 +33,7 @@ Imports - Do not import objects, only modules (*) - Do not import more than one module per line (*) - 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 diff --git a/nova/virt/hyperv/vmops.py b/nova/virt/hyperv/vmops.py index d252fbfb3..11cc8b80d 100644 --- a/nova/virt/hyperv/vmops.py +++ b/nova/virt/hyperv/vmops.py @@ -22,7 +22,6 @@ import os import uuid from nova import config -from nova import db from nova import exception from nova import flags from nova.openstack.common import cfg diff --git a/nova/virt/virtapi.py b/nova/virt/virtapi.py index 4cf769be1..85e638add 100644 --- a/nova/virt/virtapi.py +++ b/nova/virt/virtapi.py @@ -15,9 +15,6 @@ # under the License. -from nova import db - - class VirtAPI(object): def instance_update(self, context, instance_uuid, updates): """Perform an instance update operation on behalf of a virt driver diff --git a/nova/virt/xenapi/driver.py b/nova/virt/xenapi/driver.py index 0ebec1d8a..0703a9b15 100644 --- a/nova/virt/xenapi/driver.py +++ b/nova/virt/xenapi/driver.py @@ -48,7 +48,6 @@ from eventlet import timeout from nova import config from nova import context -from nova import db from nova import exception from nova import flags from nova.openstack.common import cfg diff --git a/nova/virt/xenapi/host.py b/nova/virt/xenapi/host.py index 923213e65..30d085fe2 100644 --- a/nova/virt/xenapi/host.py +++ b/nova/virt/xenapi/host.py @@ -24,7 +24,6 @@ import logging from nova.compute import task_states from nova.compute import vm_states from nova import context -from nova import db from nova import exception from nova import notifications from nova.openstack.common import jsonutils diff --git a/nova/virt/xenapi/pool.py b/nova/virt/xenapi/pool.py index a42f50274..e236528fe 100644 --- a/nova/virt/xenapi/pool.py +++ b/nova/virt/xenapi/pool.py @@ -23,7 +23,6 @@ import urlparse from nova.compute import rpcapi as compute_rpcapi from nova import config -from nova import db from nova import exception from nova import flags from nova.openstack.common import cfg diff --git a/tools/hacking.py b/tools/hacking.py index a22e1c6ff..91d8fde60 100755 --- a/tools/hacking.py +++ b/tools/hacking.py @@ -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. |