diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-02-14 20:13:46 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-04 10:42:29 +0000 |
commit | 19a868e9ad12fb27a7f713685d12f3d310fd6961 (patch) | |
tree | 388f7140b74c5d63c41e2c4595fbb9cd445b90fd /scripts/lib/wic/plugins/source/rootfs.py | |
parent | adeacb4e600b8438bd9db7e83a5cb4a118d186f3 (diff) | |
download | openembedded-core-contrib-19a868e9ad12fb27a7f713685d12f3d310fd6961.tar.gz |
wic: use wic logger in wic source plugins
Replaced msger with wic logger in wic source plugins.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'scripts/lib/wic/plugins/source/rootfs.py')
-rw-r--r-- | scripts/lib/wic/plugins/source/rootfs.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index c57a4341d1..21b653925c 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py @@ -25,15 +25,18 @@ # Joao Henrique Ferreira de Freitas <joaohf (at] gmail.com> # +import logging import os import shutil +import sys from oe.path import copyhardlinktree -from wic import msger from wic.pluginbase import SourcePlugin from wic.utils.misc import get_bitbake_var, exec_cmd +logger = logging.getLogger('wic') + class RootfsPlugin(SourcePlugin): """ Populate partition content from a rootfs directory. @@ -48,10 +51,10 @@ class RootfsPlugin(SourcePlugin): image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir) if not os.path.isdir(image_rootfs_dir): - msg = "No valid artifact IMAGE_ROOTFS from image named" - msg += " %s has been found at %s, exiting.\n" % \ - (rootfs_dir, image_rootfs_dir) - msger.error(msg) + logger.error("No valid artifact IMAGE_ROOTFS from image named %s " + "has been found at %s, exiting.\n", + rootfs_dir, image_rootfs_dir) + sys.exit(1) return image_rootfs_dir @@ -66,8 +69,9 @@ class RootfsPlugin(SourcePlugin): """ if part.rootfs_dir is None: if not 'ROOTFS_DIR' in krootfs_dir: - msg = "Couldn't find --rootfs-dir, exiting" - msger.error(msg) + logger.error("Couldn't find --rootfs-dir, exiting") + sys.exit(1) + rootfs_dir = krootfs_dir['ROOTFS_DIR'] else: if part.rootfs_dir in krootfs_dir: @@ -75,9 +79,9 @@ class RootfsPlugin(SourcePlugin): elif part.rootfs_dir: rootfs_dir = part.rootfs_dir else: - msg = "Couldn't find --rootfs-dir=%s connection" - msg += " or it is not a valid path, exiting" - msger.error(msg % part.rootfs_dir) + logger.error("Couldn't find --rootfs-dir=%s connection or " + "it is not a valid path, exiting", part.rootfs_dir) + sys.exit(1) real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir) |