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/rawcopy.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/rawcopy.py')
-rw-r--r-- | scripts/lib/wic/plugins/source/rawcopy.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py index c5c3be3c2e..561280977a 100644 --- a/scripts/lib/wic/plugins/source/rawcopy.py +++ b/scripts/lib/wic/plugins/source/rawcopy.py | |||
@@ -17,8 +17,8 @@ | |||
17 | 17 | ||
18 | import logging | 18 | import logging |
19 | import os | 19 | import os |
20 | import sys | ||
21 | 20 | ||
21 | from wic.errors import WicError | ||
22 | from wic.pluginbase import SourcePlugin | 22 | from wic.pluginbase import SourcePlugin |
23 | from wic.utils.misc import exec_cmd, get_bitbake_var | 23 | from wic.utils.misc import exec_cmd, get_bitbake_var |
24 | from wic.filemap import sparse_copy | 24 | from wic.filemap import sparse_copy |
@@ -62,14 +62,12 @@ class RawCopyPlugin(SourcePlugin): | |||
62 | if not bootimg_dir: | 62 | if not bootimg_dir: |
63 | bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") | 63 | bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") |
64 | if not bootimg_dir: | 64 | if not bootimg_dir: |
65 | logger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n") | 65 | raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") |
66 | sys.exit(1) | ||
67 | 66 | ||
68 | logger.debug('Bootimg dir: %s', bootimg_dir) | 67 | logger.debug('Bootimg dir: %s', bootimg_dir) |
69 | 68 | ||
70 | if 'file' not in source_params: | 69 | if 'file' not in source_params: |
71 | logger.error("No file specified\n") | 70 | raise WicError("No file specified") |
72 | sys.exit(1) | ||
73 | 71 | ||
74 | src = os.path.join(bootimg_dir, source_params['file']) | 72 | src = os.path.join(bootimg_dir, source_params['file']) |
75 | dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno)) | 73 | dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno)) |