mirror of
https://git.yoctoproject.org/poky
synced 2026-04-27 03:32:12 +02:00
wic: use wic logger in core modules
Replaced msger with wic logger in the core wic modules. (From OE-Core rev: cdd6675951b74075c9b9159f7465a88f83775bac) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
58ff06f1e7
commit
fe2d602240
@@ -17,8 +17,8 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
|
||||
from wic import msger
|
||||
from wic import pluginbase
|
||||
from wic.utils import errors
|
||||
from wic.utils.misc import get_bitbake_var
|
||||
@@ -30,6 +30,8 @@ PLUGIN_TYPES = ["imager", "source"]
|
||||
PLUGIN_DIR = "/lib/wic/plugins" # relative to scripts
|
||||
SCRIPTS_PLUGIN_DIR = "scripts" + PLUGIN_DIR
|
||||
|
||||
logger = logging.getLogger('wic')
|
||||
|
||||
class PluginMgr():
|
||||
plugin_dirs = {}
|
||||
|
||||
@@ -91,17 +93,16 @@ class PluginMgr():
|
||||
if mod and mod != '__init__':
|
||||
if mod in sys.modules:
|
||||
#self.plugin_dirs[pdir] = True
|
||||
msger.warning("Module %s already exists, skip" % mod)
|
||||
logger.warning("Module %s already exists, skip", mod)
|
||||
else:
|
||||
try:
|
||||
pymod = __import__(mod)
|
||||
self.plugin_dirs[pdir] = True
|
||||
msger.debug("Plugin module %s:%s imported"\
|
||||
% (mod, pymod.__file__))
|
||||
logger.debug("Plugin module %s:%s imported",
|
||||
mod, pymod.__file__)
|
||||
except ImportError as err:
|
||||
msg = 'Failed to load plugin %s/%s: %s' \
|
||||
% (os.path.basename(pdir), mod, err)
|
||||
msger.warning(msg)
|
||||
logger.warning('Failed to load plugin %s/%s: %s',
|
||||
os.path.basename(pdir), mod, err)
|
||||
|
||||
del sys.path[0]
|
||||
|
||||
@@ -140,8 +141,8 @@ class PluginMgr():
|
||||
if _source_name == source_name:
|
||||
for _method_name in methods:
|
||||
if not hasattr(klass, _method_name):
|
||||
msger.warning("Unimplemented %s source interface for: %s"\
|
||||
% (_method_name, _source_name))
|
||||
logger.warning("Unimplemented %s source interface for: %s",
|
||||
_method_name, _source_name)
|
||||
return None
|
||||
func = getattr(klass, _method_name)
|
||||
methods[_method_name] = func
|
||||
|
||||
Reference in New Issue
Block a user