From 99308d4dd3b16e00af4e610be4f07c7d99e49846 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Mon, 25 Feb 2013 19:44:29 -0800 Subject: 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 --- tools/hacking.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit