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 ] Signed-off-by: Peter Kjellerstedt <peter.kjellerst...@axis.com> --- meta/classes-recipe/image.bbclass | 15 ++++----------- meta/lib/oe/utils.py | 13 ------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index 834ae03f3c..00f1d58f23 100644 --- a/meta/classes-recipe/image.bbclass +++ b/meta/classes-recipe/image.bbclass @@ -324,27 +324,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) } diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 83f1440887..c9c7a47041 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -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)
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#204981): https://lists.openembedded.org/g/openembedded-core/message/204981 Mute This Topic: https://lists.openembedded.org/mt/108666218/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-