summaryrefslogtreecommitdiffstats
path: root/tools/hacking.py
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2013-02-25 19:44:29 -0800
committerJoe Gordon <jogo@cloudscaling.com>2013-02-25 19:47:29 -0800
commit99308d4dd3b16e00af4e610be4f07c7d99e49846 (patch)
tree5eda568968ae3564e7fc16fb75ee3a00dde1e372 /tools/hacking.py
parent0f0a8c6bcce1b230a5719b35089f25e55a1359a8 (diff)
downloadnova-99308d4dd3b16e00af4e610be4f07c7d99e49846.tar.gz
nova-99308d4dd3b16e00af4e610be4f07c7d99e49846.tar.xz
nova-99308d4dd3b16e00af4e610be4f07c7d99e49846.zip
Fix hacking.py to handle 'cannot import x'
Fix missingImport logic to handle a module that cannot be imported, due to a missing dependant module. Due to the nature of this bug doctests cannot cover it. Fix bug 1133103 Change-Id: Ia067bacc125b67e2d9e0cfc72495e4f13a8648ad
Diffstat (limited to 'tools/hacking.py')
-rwxr-xr-xtools/hacking.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/hacking.py b/tools/hacking.py
index 1279e87e9..5b301d540 100755
--- a/tools/hacking.py
+++ b/tools/hacking.py
@@ -201,7 +201,8 @@ def nova_import_rules(logical_line):
# NOTE(vish): the import error might be due
# to a missing dependency
missing = str(exc).split()[-1]
- if missing != mod.split('.')[-1]:
+ if (missing != mod.split('.')[-1] or
+ "cannot import" in str(exc)):
_missingImport.add(missing)
return True
return False