diff options
author | Monty Taylor <mordred@inaugust.com> | 2012-08-15 15:39:43 -0400 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2012-08-17 13:38:29 -0400 |
commit | c1c068bb6bad003df451f0fa5ceb2b85bdf799a2 (patch) | |
tree | 46404c135b85726c3b70833ae607da28501d43c3 /tools/hacking.py | |
parent | 740ebdce965d4d2ebe1050fe4de2b84d7726922f (diff) | |
download | nova-c1c068bb6bad003df451f0fa5ceb2b85bdf799a2.tar.gz nova-c1c068bb6bad003df451f0fa5ceb2b85bdf799a2.tar.xz nova-c1c068bb6bad003df451f0fa5ceb2b85bdf799a2.zip |
Make missing imports flag in hacking settable.
Change-Id: Ib1ada320588eb42370c9fa2c0eff4eb888258ea5
Diffstat (limited to 'tools/hacking.py')
-rwxr-xr-x | tools/hacking.py | 9 |
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() |