]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
toasterui: ensure that the Build object is always available
authorElliot Smith <elliot.smith@intel.com>
Thu, 4 Aug 2016 15:32:33 +0000 (16:32 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Aug 2016 23:08:18 +0000 (00:08 +0100)
commit0990b4c73f194ec0be1762e4e48b1a525d8349fb
tree2adcffe82fb3d0d923426ebabb474771085ce6e2
parentb7a699e701785b5bd8da97b6e1b760a1c6dd05f5
toasterui: ensure that the Build object is always available

Many of the methods in toasterui and buildinfohelper rely
on the internal state of the buildinfohelper; in particular, they
need a Build object to have been created on the buildinfohelper.

If the creation of this Build object is tied to an event which
may or may not occur, there's no guarantee that it will exist.
This then causes assertion errors in those methods.

To prevent this from happening, add an _ensure_build() method
to buildinfohelper. This ensures that a minimal Build object
is always available whenever it is needed, either by retrieving
it from the BuildRequest or creating it; it also ensures that
the Build object is up to date with whatever data is available
on the bitbake server (DISTRO, MACHINE etc.).

This method is then called by any other method which relies on
a Build object being in the internal state, ensuring that the
object is either available, or creating it.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
lib/bb/ui/buildinfohelper.py
lib/bb/ui/toasterui.py