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 23:18:17 +0000 |
commit | 8da175607c0d3434428a3bf4ee1549919b698709 (patch) | |
tree | 1122f66b976598d3d3aa77cacc67659ccdda0c7c /scripts/lib/wic/plugins/source/rootfs.py | |
parent | f5ae79da406190bf27194d7cecf15926bbb6ef20 (diff) | |
download | poky-8da175607c0d3434428a3bf4ee1549919b698709.tar.gz |
wic: raise WicError in wic plugins
Replaced sys.exit with raising WicError in wic plugins.
(From OE-Core rev: 92e8c81c941597eb2b4b61d5c28833e4826888f8)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 @@ | |||
28 | import logging | 28 | import logging |
29 | import os | 29 | import os |
30 | import shutil | 30 | import shutil |
31 | import sys | ||
32 | 31 | ||
33 | from oe.path import copyhardlinktree | 32 | from oe.path import copyhardlinktree |
34 | 33 | ||
34 | from wic.errors import WicError | ||
35 | from wic.pluginbase import SourcePlugin | 35 | from wic.pluginbase import SourcePlugin |
36 | from wic.utils.misc import get_bitbake_var, exec_cmd | 36 | from wic.utils.misc import get_bitbake_var, exec_cmd |
37 | 37 | ||
@@ -51,10 +51,9 @@ class RootfsPlugin(SourcePlugin): | |||
51 | 51 | ||
52 | image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir) | 52 | image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir) |
53 | if not os.path.isdir(image_rootfs_dir): | 53 | if not os.path.isdir(image_rootfs_dir): |
54 | logger.error("No valid artifact IMAGE_ROOTFS from image named %s " | 54 | raise WicError("No valid artifact IMAGE_ROOTFS from image " |
55 | "has been found at %s, exiting.\n", | 55 | "named %s has been found at %s, exiting." % |
56 | rootfs_dir, image_rootfs_dir) | 56 | (rootfs_dir, image_rootfs_dir)) |
57 | sys.exit(1) | ||
58 | 57 | ||
59 | return image_rootfs_dir | 58 | return image_rootfs_dir |
60 | 59 | ||
@@ -69,8 +68,7 @@ class RootfsPlugin(SourcePlugin): | |||
69 | """ | 68 | """ |
70 | if part.rootfs_dir is None: | 69 | if part.rootfs_dir is None: |
71 | if not 'ROOTFS_DIR' in krootfs_dir: | 70 | if not 'ROOTFS_DIR' in krootfs_dir: |
72 | logger.error("Couldn't find --rootfs-dir, exiting") | 71 | raise WicError("Couldn't find --rootfs-dir, exiting") |
73 | sys.exit(1) | ||
74 | 72 | ||
75 | rootfs_dir = krootfs_dir['ROOTFS_DIR'] | 73 | rootfs_dir = krootfs_dir['ROOTFS_DIR'] |
76 | else: | 74 | else: |
@@ -79,9 +77,8 @@ class RootfsPlugin(SourcePlugin): | |||
79 | elif part.rootfs_dir: | 77 | elif part.rootfs_dir: |
80 | rootfs_dir = part.rootfs_dir | 78 | rootfs_dir = part.rootfs_dir |
81 | else: | 79 | else: |
82 | logger.error("Couldn't find --rootfs-dir=%s connection or " | 80 | raise WicError("Couldn't find --rootfs-dir=%s connection or " |
83 | "it is not a valid path, exiting", part.rootfs_dir) | 81 | "it is not a valid path, exiting" % part.rootfs_dir) |
84 | sys.exit(1) | ||
85 | 82 | ||
86 | real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir) | 83 | real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir) |
87 | 84 | ||