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/bootimg-partition.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/bootimg-partition.py')
| -rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-partition.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py index b4869154fe..e9724a63a3 100644 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py | |||
| @@ -26,10 +26,10 @@ | |||
| 26 | import logging | 26 | import logging |
| 27 | import os | 27 | import os |
| 28 | import re | 28 | import re |
| 29 | import sys | ||
| 30 | 29 | ||
| 31 | from glob import glob | 30 | from glob import glob |
| 32 | 31 | ||
| 32 | from wic.errors import WicError | ||
| 33 | from wic.pluginbase import SourcePlugin | 33 | from wic.pluginbase import SourcePlugin |
| 34 | from wic.utils.misc import exec_cmd, get_bitbake_var | 34 | from wic.utils.misc import exec_cmd, get_bitbake_var |
| 35 | 35 | ||
| @@ -81,16 +81,14 @@ class BootimgPartitionPlugin(SourcePlugin): | |||
| 81 | if not bootimg_dir: | 81 | if not bootimg_dir: |
| 82 | bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") | 82 | bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") |
| 83 | if not bootimg_dir: | 83 | if not bootimg_dir: |
| 84 | logger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n") | 84 | raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") |
| 85 | sys.exit(1) | ||
| 86 | 85 | ||
| 87 | logger.debug('Bootimg dir: %s', bootimg_dir) | 86 | logger.debug('Bootimg dir: %s', bootimg_dir) |
| 88 | 87 | ||
| 89 | boot_files = get_bitbake_var("IMAGE_BOOT_FILES") | 88 | boot_files = get_bitbake_var("IMAGE_BOOT_FILES") |
| 90 | 89 | ||
| 91 | if not boot_files: | 90 | if not boot_files: |
| 92 | logger.error('No boot files defined, IMAGE_BOOT_FILES unset') | 91 | raise WicError('No boot files defined, IMAGE_BOOT_FILES unset') |
| 93 | sys.exit(1) | ||
| 94 | 92 | ||
| 95 | logger.debug('Boot files: %s', boot_files) | 93 | logger.debug('Boot files: %s', boot_files) |
| 96 | 94 | ||
| @@ -100,8 +98,7 @@ class BootimgPartitionPlugin(SourcePlugin): | |||
| 100 | if ';' in src_entry: | 98 | if ';' in src_entry: |
| 101 | dst_entry = tuple(src_entry.split(';')) | 99 | dst_entry = tuple(src_entry.split(';')) |
| 102 | if not dst_entry[0] or not dst_entry[1]: | 100 | if not dst_entry[0] or not dst_entry[1]: |
| 103 | logger.error('Malformed boot file entry: %s', src_entry) | 101 | raise WicError('Malformed boot file entry: %s' % src_entry) |
| 104 | sys.exit(1) | ||
| 105 | else: | 102 | else: |
| 106 | dst_entry = (src_entry, src_entry) | 103 | dst_entry = (src_entry, src_entry) |
| 107 | 104 | ||
