diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-02-14 23:07:35 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-04 10:42:30 +0000 |
commit | 92e8c81c941597eb2b4b61d5c28833e4826888f8 (patch) | |
tree | 2d445c700d09aa84f6e04a0757dc2e4dfd4353b8 /scripts/lib/wic/plugins/source/rootfs.py | |
parent | 1b11437fb25ece5b3eede52344b071e875fa738f (diff) | |
download | openembedded-core-contrib-92e8c81c941597eb2b4b61d5c28833e4826888f8.tar.gz |
wic: raise WicError in wic plugins
Replaced sys.exit with raising WicError in wic 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 | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index 21b653925c..f7ca569604 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py @@ -28,10 +28,10 @@ import logging import os import shutil -import sys from oe.path import copyhardlinktree +from wic.errors import WicError from wic.pluginbase import SourcePlugin from wic.utils.misc import get_bitbake_var, exec_cmd @@ -51,10 +51,9 @@ class RootfsPlugin(SourcePlugin): image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir) if not os.path.isdir(image_rootfs_dir): - 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) + raise WicError("No valid artifact IMAGE_ROOTFS from image " + "named %s has been found at %s, exiting." % + (rootfs_dir, image_rootfs_dir)) return image_rootfs_dir @@ -69,8 +68,7 @@ class RootfsPlugin(SourcePlugin): """ if part.rootfs_dir is None: if not 'ROOTFS_DIR' in krootfs_dir: - logger.error("Couldn't find --rootfs-dir, exiting") - sys.exit(1) + raise WicError("Couldn't find --rootfs-dir, exiting") rootfs_dir = krootfs_dir['ROOTFS_DIR'] else: @@ -79,9 +77,8 @@ class RootfsPlugin(SourcePlugin): elif part.rootfs_dir: rootfs_dir = part.rootfs_dir else: - logger.error("Couldn't find --rootfs-dir=%s connection or " - "it is not a valid path, exiting", part.rootfs_dir) - sys.exit(1) + raise WicError("Couldn't find --rootfs-dir=%s connection or " + "it is not a valid path, exiting" % part.rootfs_dir) real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir) |