]> code.ossystems Code Review - openembedded-core.git/commit
buildhistory.bbclass: avoid exception for empty BUILDHISTORY_FEATURES variable
authorPeter Bergin <peter@berginkonsult.se>
Fri, 29 Jan 2021 09:50:54 +0000 (10:50 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Mon, 1 Feb 2021 05:43:10 +0000 (13:43 +0800)
commit83ee03a6f05ff60459dbcc4fcfb78f95bb0b4848
treeb9f04480e2d27cfeb09f719302c5726d23ea032c
parent6d8a58b11117372fdbf0a86fbc6698ee509fc816
buildhistory.bbclass: avoid exception for empty BUILDHISTORY_FEATURES variable

An exception is fired when a BuildStarted event is sent to buildhistory bbclass
and the variable BUILDHISTORY_FEATURES is not set.

    ERROR: Execution of event handler 'buildhistory_eventhandler' failed
    Traceback (most recent call last):
      File "<...>/meta/classes/buildhistory.bbclass", line 862, in buildhistory_eventhandler(e=<bb.event.BuildStarted object at 0x7f94c3810250>):
         python buildhistory_eventhandler() {
        >    if e.data.getVar('BUILDHISTORY_FEATURES').strip():
                 reset = e.data.getVar("BUILDHISTORY_RESET")
    AttributeError: 'NoneType' object has no attribute 'strip'

This can happen in a multiconfig build where the default configuration use the
buildhistory class but not the configuration in mc. It should be a rare case that
this happens and it was found in a missconfigured build.

(From OE-Core rev: a74e30a4de02c8efd3e7102ba7a4fe06df53cc34)

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 55ead1be58679c3bcb7d1c141672b999d53e90ef)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/classes/buildhistory.bbclass