summaryrefslogtreecommitdiffstats
path: root/lib/bb/ui/buildinfohelper.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-07-04 12:17:35 +0100
committerAlexandru DAMIAN <alexandru.damian@intel.com>2014-07-09 17:33:35 +0100
commitaf1d3373706d365f9138caec110fcb20a5966b7b (patch)
tree3bc132eb42f1090633ff1b5a27dd3d68dcf013f1 /lib/bb/ui/buildinfohelper.py
parent8855daebe55917c4f5855413d02ae1f3f7f76571 (diff)
downloadbitbake-contrib-af1d3373706d365f9138caec110fcb20a5966b7b.tar.gz
toasterui: fix build - project identification
This patches fixes the build - project identification when running under managed mode. The build is assigned to the project from which it was triggered, and to the build request, as to simplify relationships queries in the database. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'lib/bb/ui/buildinfohelper.py')
-rw-r--r--lib/bb/ui/buildinfohelper.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 77be7c744..29cfc81ce 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -46,7 +46,7 @@ class ORMWrapper(object):
pass
- def create_build_object(self, build_info):
+ def create_build_object(self, build_info, brbe):
assert 'machine' in build_info
assert 'distro' in build_info
assert 'distro_version' in build_info
@@ -65,6 +65,13 @@ class ORMWrapper(object):
build_name=build_info['build_name'],
bitbake_version=build_info['bitbake_version'])
+ if brbe is not None:
+ from bldcontrol.models import BuildEnvironment, BuildRequest
+ br, be = brbe.split(":")
+ buildrequest = BuildRequest.objects.get(pk = br)
+ build.project = buildrequest.project
+ build.save()
+
return build
def create_target_objects(self, target_info):
@@ -600,7 +607,10 @@ class BuildInfoHelper(object):
assert '_pkgs' in vars(event)
build_information = self._get_build_information()
- build_obj = self.orm_wrapper.create_build_object(build_information)
+ brbe = self.server.runCommand(["getVariable", "TOASTER_BRBE"])[0]
+
+ build_obj = self.orm_wrapper.create_build_object(build_information, brbe)
+
self.internal_state['build'] = build_obj
# save layer version information for this build
@@ -619,6 +629,9 @@ class BuildInfoHelper(object):
# Save build configuration
self.orm_wrapper.save_build_variables(build_obj, self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0])
+ return brbe
+
+
def update_target_image_file(self, event):
image_fstypes = self.server.runCommand(["getVariable", "IMAGE_FSTYPES"])[0]
for t in self.internal_state['targets']: