mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
image.bbclass: Drop support for ImageQAFailed exceptions in image_qa
After commit 905e224849fbbed1719e0add231b00e2d570b3b4 (image_qa: fix error handling), any unexpected exceptions in do_image_qa() would result in a variable being set, but never used, effectively hiding the error. Since image_qa now calls oe.qa.exit_if_errors(), remove the support for oe.utils.ImageQAFailed and instead rely on the called functions to call oe.qa.handle_error() themselves. This matches what do_package_qa() does. Also update the description of do_image_qa() to explain that the called functions are expected to call oe.qa.handle_error() themselves. [ YOCTO #15601 ] (From OE-Core rev: a1b28a88bc7697371ab166b18587b615d6d39c8e) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0c3e111c965af2bc56533633c376b70b7fa5e1de) Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
8156bb675c
commit
200d12b6a5
@@ -303,27 +303,20 @@ addtask do_image_complete_setscene
|
||||
# IMAGE_QA_COMMANDS += " \
|
||||
# image_check_everything_ok \
|
||||
# "
|
||||
#
|
||||
# This task runs all functions in IMAGE_QA_COMMANDS after the rootfs
|
||||
# construction has completed in order to validate the resulting image.
|
||||
#
|
||||
# The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs
|
||||
# directory, which if QA passes will be the basis for the images.
|
||||
#
|
||||
# The functions should use oe.utils.ImageQAFailed(description, name) to raise
|
||||
# errors. The name must be listed in ERROR_QA or WARN_QA to prompt.
|
||||
# The functions are expected to call oe.qa.handle_error() to report any
|
||||
# problems.
|
||||
fakeroot python do_image_qa () {
|
||||
from oe.utils import ImageQAFailed
|
||||
|
||||
qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split()
|
||||
|
||||
for cmd in qa_cmds:
|
||||
try:
|
||||
bb.build.exec_func(cmd, d)
|
||||
except oe.utils.ImageQAFailed as e:
|
||||
qamsg = 'Image QA function %s failed: %s\n' % (e.name, e.description)
|
||||
oe.qa.handle_error(e.name, qamsg, d)
|
||||
except Exception as e:
|
||||
qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (cmd, e)
|
||||
bb.build.exec_func(cmd, d)
|
||||
|
||||
oe.qa.exit_if_errors(d)
|
||||
}
|
||||
|
||||
@@ -482,19 +482,6 @@ def get_multilib_datastore(variant, d):
|
||||
localdata.setVar("MLPREFIX", "")
|
||||
return localdata
|
||||
|
||||
class ImageQAFailed(bb.BBHandledException):
|
||||
def __init__(self, description, name=None, logfile=None):
|
||||
self.description = description
|
||||
self.name = name
|
||||
self.logfile=logfile
|
||||
|
||||
def __str__(self):
|
||||
msg = 'Function failed: %s' % self.name
|
||||
if self.description:
|
||||
msg = msg + ' (%s)' % self.description
|
||||
|
||||
return msg
|
||||
|
||||
def sh_quote(string):
|
||||
import shlex
|
||||
return shlex.quote(string)
|
||||
|
||||
Reference in New Issue
Block a user