aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins/source/bootimg-pcbios.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-02-14 23:07:35 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-04 10:42:30 +0000
commit92e8c81c941597eb2b4b61d5c28833e4826888f8 (patch)
tree2d445c700d09aa84f6e04a0757dc2e4dfd4353b8 /scripts/lib/wic/plugins/source/bootimg-pcbios.py
parent1b11437fb25ece5b3eede52344b071e875fa738f (diff)
downloadopenembedded-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/bootimg-pcbios.py')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-pcbios.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index 8f53fa2a48..2ded2dac52 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -26,10 +26,9 @@
import logging
import os
-import sys
from wic.engine import get_custom_config
-from wic.errors import ImageError
+from wic.errors import ImageError, WicError
from wic.utils import runner
from wic.pluginbase import SourcePlugin
from wic.utils.misc import (exec_cmd, exec_native_cmd,
@@ -57,14 +56,13 @@ class BootimgPcbiosPlugin(SourcePlugin):
elif creator.ptable_format == 'gpt':
mbrfile += "gptmbr.bin"
else:
- logger.error("Unsupported partition table: %s", creator.ptable_format)
- sys.exit(1)
+ raise WicError("Unsupported partition table: %s" %
+ creator.ptable_format)
if not os.path.exists(mbrfile):
- logger.error("Couldn't find %s. If using the -e option, do you "
- "have the right MACHINE set in local.conf? If not, "
- "is the bootimg_dir path correct?", mbrfile)
- sys.exit(1)
+ raise WicError("Couldn't find %s. If using the -e option, do you "
+ "have the right MACHINE set in local.conf? If not, "
+ "is the bootimg_dir path correct?" % mbrfile)
full_path = creator._full_path(workdir, disk_name, "direct")
logger.debug("Installing MBR on disk %s as %s with size %s bytes",
@@ -152,11 +150,9 @@ class BootimgPcbiosPlugin(SourcePlugin):
if not _has_syslinux(bootimg_dir):
bootimg_dir = get_bitbake_var("STAGING_DATADIR", "wic-tools")
if not bootimg_dir:
- logger.error("Couldn't find STAGING_DATADIR, exiting\n")
- sys.exit(1)
+ raise WicError("Couldn't find STAGING_DATADIR, exiting")
if not _has_syslinux(bootimg_dir):
- logger.error("Please build syslinux first\n")
- sys.exit(1)
+ raise WicError("Please build syslinux first")
# just so the result notes display it
creator.bootimg_dir = bootimg_dir