diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-02-14 18:54:32 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-04 10:42:29 +0000 |
commit | cdd6675951b74075c9b9159f7465a88f83775bac (patch) | |
tree | 77ddf864974970466bb0463b323c7d96a2c6b0fe /scripts/lib/wic/engine.py | |
parent | f7d9e33aa129d8ab98dd1971154c29c275d103b0 (diff) | |
download | openembedded-core-contrib-cdd6675951b74075c9b9159f7465a88f83775bac.tar.gz |
wic: use wic logger in core modules
Replaced msger with wic logger in the core wic modules.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'scripts/lib/wic/engine.py')
-rw-r--r-- | scripts/lib/wic/engine.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py index 1aa8f6534e..b64714c686 100644 --- a/scripts/lib/wic/engine.py +++ b/scripts/lib/wic/engine.py @@ -28,6 +28,7 @@ # Tom Zanussi <tom.zanussi (at] linux.intel.com> # +import logging import os import sys @@ -35,6 +36,7 @@ from wic import msger from wic.plugin import pluginmgr from wic.utils.misc import get_bitbake_var +logger = logging.getLogger('wic') def verify_build_env(): """ @@ -43,7 +45,7 @@ def verify_build_env(): Returns True if it is, false otherwise """ if not os.environ.get("BUILDDIR"): - print("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)") + logger.error("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)") sys.exit(1) return True @@ -179,7 +181,7 @@ def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir, try: oe_builddir = os.environ["BUILDDIR"] except KeyError: - print("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)") + logger.error("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)") sys.exit(1) if options.debug: @@ -191,14 +193,15 @@ def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir, pname = 'direct' plugin_class = pluginmgr.get_plugins('imager').get(pname) if not plugin_class: - msger.error('Unknown plugin: %s' % pname) + logger.error('Unknown plugin: %s', pname) + sys.exit(1) plugin = plugin_class(wks_file, rootfs_dir, bootimg_dir, kernel_dir, native_sysroot, oe_builddir, options) plugin.do_create() - print("\nThe image(s) were created using OE kickstart file:\n %s" % wks_file) + logger.info("The image(s) were created using OE kickstart file:\n %s", wks_file) def wic_list(args, scripts_path): @@ -218,10 +221,10 @@ def wic_list(args, scripts_path): wks_file = args[0] fullpath = find_canned_image(scripts_path, wks_file) if not fullpath: - print("No image named %s found, exiting. "\ - "(Use 'wic list images' to list available images, or "\ - "specify a fully-qualified OE kickstart (.wks) "\ - "filename)\n" % wks_file) + logger.error("No image named %s found, exiting. " + "(Use 'wic list images' to list available images, or " + "specify a fully-qualified OE kickstart (.wks) " + "filename)\n", wks_file) sys.exit(1) list_canned_image_help(scripts_path, fullpath) return True |