summaryrefslogtreecommitdiffstats
path: root/tools/hacking.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-08-20 07:42:18 +0000
committerGerrit Code Review <review@openstack.org>2012-08-20 07:42:18 +0000
commite4f038d5bd3def8c275a9fd89ecd28912ead3b6e (patch)
tree0f4cbe51a812266e96480a8033ab4e638933e71d /tools/hacking.py
parent031598f7820f05a7ea6dd84e71d500b53083ad7c (diff)
parentc1c068bb6bad003df451f0fa5ceb2b85bdf799a2 (diff)
downloadnova-e4f038d5bd3def8c275a9fd89ecd28912ead3b6e.tar.gz
nova-e4f038d5bd3def8c275a9fd89ecd28912ead3b6e.tar.xz
nova-e4f038d5bd3def8c275a9fd89ecd28912ead3b6e.zip
Merge "Make missing imports flag in hacking settable."
Diffstat (limited to 'tools/hacking.py')
-rwxr-xr-xtools/hacking.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/hacking.py b/tools/hacking.py
index 4eb2141f7..88d074794 100755
--- a/tools/hacking.py
+++ b/tools/hacking.py
@@ -47,7 +47,7 @@ logging.disable('LOG')
IMPORT_EXCEPTIONS = ['sqlalchemy', 'migrate', 'nova.db.sqlalchemy.session']
DOCSTRING_TRIPLE = ['"""', "'''"]
-VERBOSE_MISSING_IMPORT = False
+VERBOSE_MISSING_IMPORT = os.getenv('HACKING_VERBOSE_MISSING_IMPORT', 'False')
# Monkey patch broken excluded filter in pep8
@@ -218,9 +218,10 @@ def nova_import_module_only(logical_line):
else:
name = logical_line.split()[1]
if name not in _missingImport:
- if VERBOSE_MISSING_IMPORT:
- print >> sys.stderr, ("ERROR: import '%s' failed: %s" %
- (name, exc))
+ if VERBOSE_MISSING_IMPORT != 'False':
+ print >> sys.stderr, ("ERROR: import '%s' in %s "
+ "failed: %s" %
+ (name, pep8.current_file, exc))
_missingImport.add(name)
added = False
sys.path.pop()