summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-09-22 10:34:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 22:41:03 +0100
commitaab4aff75eefb31aa53885d7735feee5daa294aa (patch)
treeb47d1629d23afc6e6107458b70fd6e9e84e9768a
parent0a69a8a18075c976ed8681d9d75529f8c2f48514 (diff)
downloadbitbake-aab4aff75eefb31aa53885d7735feee5daa294aa.zip
toaster: don't re-create Target objects
Due to re-creating Target objects from bitbake events task information stored in original objects is lost. There is no valid reason to remove existing objects. It's safer to query them instead of re-creating as original object contain more information than events coming from bitbake. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/ui/buildinfohelper.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 6e313fee..e5f1e099 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -161,8 +161,6 @@ class ORMWrapper(object):
build.bitbake_version=build_info['bitbake_version']
build.save()
- Target.objects.filter(build = build).delete()
-
else:
build = Build.objects.create(
project = prj,
@@ -183,19 +181,6 @@ class ORMWrapper(object):
return build
- def create_target_objects(self, target_info):
- assert 'build' in target_info
- assert 'targets' in target_info
-
- targets = []
- for tgt_name in target_info['targets']:
- tgt_object = Target.objects.create( build = target_info['build'],
- target = tgt_name,
- is_image = False,
- )
- targets.append(tgt_object)
- return targets
-
def update_build_object(self, build, errors, warnings, taskfailures):
assert isinstance(build,Build)
assert isinstance(errors, int)
@@ -869,7 +854,7 @@ class BuildInfoHelper(object):
target_information['targets'] = event._pkgs
target_information['build'] = build_obj
- self.internal_state['targets'] = self.orm_wrapper.create_target_objects(target_information)
+ self.internal_state['targets'] = Target.objects.filter(build=target_information['build'])
# Save build configuration
data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0]