From 3d552a40bcfebe2975ed256e57d480434f94e1b5 Mon Sep 17 00:00:00 2001 From: Huang Hao Date: Thu, 28 Feb 2013 13:41:35 +0800 Subject: [PATCH] Give reason when failed to load plugin module. It will be helpful to solve problems. Change-Id: I02f36706c67cfb9fedc9029ea5a177aa85c2ac61 --- mic/plugin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mic/plugin.py b/mic/plugin.py index 41c5665..c1153a9 100644 --- a/mic/plugin.py +++ b/mic/plugin.py @@ -74,9 +74,10 @@ class PluginMgr(object): self.plugin_dirs[pdir] = True msger.debug("Plugin module %s:%s imported"\ % (mod, pymod.__file__)) - except ImportError, e: - msger.warning('Loading failed, skip plugin %s/%s'\ - % (os.path.basename(pdir), mod)) + except ImportError, err: + msg = 'Failed to load plugin %s/%s: %s' \ + % (os.path.basename(pdir), mod, err) + msger.warning(msg) del(sys.path[0]) -- 2.7.4