diff options
author | Joe Gordon <jogo@cloudscaling.com> | 2013-02-25 19:44:29 -0800 |
---|---|---|
committer | Joe Gordon <jogo@cloudscaling.com> | 2013-02-25 19:47:29 -0800 |
commit | 99308d4dd3b16e00af4e610be4f07c7d99e49846 (patch) | |
tree | 5eda568968ae3564e7fc16fb75ee3a00dde1e372 /tools/hacking.py | |
parent | 0f0a8c6bcce1b230a5719b35089f25e55a1359a8 (diff) | |
download | nova-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-x | tools/hacking.py | 3 |
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 |