summaryrefslogtreecommitdiffstats
path: root/nova/hacking
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-05-17 12:54:12 -0700
committerMonty Taylor <mordred@inaugust.com>2013-05-17 12:54:12 -0700
commita333be8fe4ec0abc49e85d0c689b8ffba2a473eb (patch)
treeea6a8037626de002ce60e8e5a82f1053bdb50a40 /nova/hacking
parent186c49409c841bd2bba50ea8629ec214a7fb9627 (diff)
downloadnova-a333be8fe4ec0abc49e85d0c689b8ffba2a473eb.tar.gz
nova-a333be8fe4ec0abc49e85d0c689b8ffba2a473eb.tar.xz
nova-a333be8fe4ec0abc49e85d0c689b8ffba2a473eb.zip
Switch to flake8+hacking.
Remove a bunch of local custom scripts. Replace with configurable external tools. Use local hacking checks for nova specifics. Change-Id: I75a01375ba0ec36d2ff05abc47abe0a3f225eda5
Diffstat (limited to 'nova/hacking')
-rw-r--r--nova/hacking/__init__.py0
-rw-r--r--nova/hacking/checks.py31
2 files changed, 31 insertions, 0 deletions
diff --git a/nova/hacking/__init__.py b/nova/hacking/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/nova/hacking/__init__.py
diff --git a/nova/hacking/checks.py b/nova/hacking/checks.py
new file mode 100644
index 000000000..49fbf15f4
--- /dev/null
+++ b/nova/hacking/checks.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2012, Cloudscaling
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+
+def 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.
+
+ N307
+ """
+ if "nova/virt" in filename and not filename.endswith("fake.py"):
+ if logical_line.startswith("from nova import db"):
+ yield (0, "N307: nova.db import not allowed in nova/virt/*")
+
+
+def factory(register):
+ register(import_no_db_in_virt)