bitbake: toasterui: verify variable before usage

This patch verifies that BRBE is set before trying to use
it to read the checkout paths. This is needed for builds
ran outside Toaster control.

(Bitbake rev: e04807cd3135c9de96cc7f79245f329c24618b85)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN 2015-06-24 14:53:21 +01:00 committed by Richard Purdie
parent 8ef5165b5a
commit 583e320764
1 changed files with 5 additions and 4 deletions

View File

@ -860,10 +860,11 @@ class BuildInfoHelper(object):
# convert the paths from absolute to relative to either the build directory or layer checkouts
path_prefixes = []
br_id, be_id = self.brbe.split(":")
from bldcontrol.models import BuildEnvironment, BuildRequest
be = BuildEnvironment.objects.get(pk = be_id)
path_prefixes.append(be.builddir)
if self.brbe is not None:
br_id, be_id = self.brbe.split(":")
from bldcontrol.models import BuildEnvironment, BuildRequest
be = BuildEnvironment.objects.get(pk = be_id)
path_prefixes.append(be.builddir)
for layer in sorted(self.orm_wrapper.layer_version_objects, key = lambda x:len(x.local_path), reverse=True):
path_prefixes.append(layer.local_path)