Give reason when failed to load plugin module.
authorHuang Hao <hao.h.huang@intel.com>
Thu, 28 Feb 2013 05:41:35 +0000 (13:41 +0800)
committerGerrit Code Review <gerrit2@otctools.jf.intel.com>
Thu, 28 Feb 2013 06:47:30 +0000 (22:47 -0800)
It will be helpful to solve problems.

Change-Id: I02f36706c67cfb9fedc9029ea5a177aa85c2ac61

mic/plugin.py

index 41c5665..c1153a9 100644 (file)
@@ -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])