diff options
| author | Ravi Chintakunta <ravi.chintakunta@timesys.com> | 2014-02-17 23:30:41 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-09 12:24:00 -0700 |
| commit | 31d4bf8484ee42690386c6b7a6bd6c7a2be54464 (patch) | |
| tree | b9ef1f8c22dc51445c9ba6a35f05e091262a47b2 /bitbake/lib/toaster/toastergui/views.py | |
| parent | 2bd19cd02623b7c5494c2f7057587252a75746c9 (diff) | |
| download | poky-31d4bf8484ee42690386c6b7a6bd6c7a2be54464.tar.gz | |
bitbake: toaster: View detailed information about a task
Information about a task is displayed depending on it's execution
status and outcome status.
Edited to iterate through all possible entries for related setscene
tasks.
[YOCTO #4282]
(Bitbake rev: 62f502b1237d4060df6be1ee4f4865db5fa39a6a)
Signed-off-by: Ravi Chintakunta <ravi.chintakunta@timesys.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 11c8fd806e..b77be1a6e7 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -349,12 +349,36 @@ def builddashboard(request, build_id): | |||
| 349 | return render(request, template, context) | 349 | return render(request, template, context) |
| 350 | 350 | ||
| 351 | def task(request, build_id, task_id): | 351 | def task(request, build_id, task_id): |
| 352 | template = "singletask.html" | 352 | template = "task.html" |
| 353 | if Build.objects.filter(pk=build_id).count() == 0 : | 353 | if Task.objects.filter(pk=task_id).count() == 0 : |
| 354 | return redirect(builds) | 354 | return redirect(builds) |
| 355 | task = Task.objects.filter(pk=task_id)[0] | ||
| 356 | |||
| 357 | dependencies = sorted(_find_task_dep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name)) | ||
| 358 | reverse_dependencies = sorted(_find_task_revdep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name)) | ||
| 359 | |||
| 360 | log_head = '' | ||
| 361 | log_body = '' | ||
| 362 | if task.outcome == task.OUTCOME_FAILED: | ||
| 363 | pass | ||
| 364 | # FIXME: the log should be read from the orm_logmessage table. | ||
| 365 | # This will be fixed when the backend is done. | ||
| 366 | |||
| 355 | context = { | 367 | context = { |
| 356 | 'build' : Build.objects.filter(pk=build_id)[0], | 368 | 'build' : Build.objects.filter(pk=build_id)[0], |
| 369 | 'object': task, | ||
| 370 | 'task':task, | ||
| 371 | 'deps': dependencies, | ||
| 372 | 'rdeps': reverse_dependencies, | ||
| 373 | 'log_head':log_head, | ||
| 374 | 'log_body':log_body, | ||
| 375 | 'showing_matches':False, | ||
| 357 | } | 376 | } |
| 377 | |||
| 378 | if request.GET.get('show_matches', ""): | ||
| 379 | context['showing_matches'] = True | ||
| 380 | context['matching_tasks'] = Task.objects.filter(sstate_checksum=task.sstate_checksum).filter(build__completed_on__lt=task.build.completed_on).order_by('-build__completed_on') | ||
| 381 | |||
| 358 | return render(request, template, context) | 382 | return render(request, template, context) |
| 359 | 383 | ||
| 360 | def recipe(request, build_id, recipe_id): | 384 | def recipe(request, build_id, recipe_id): |
| @@ -388,6 +412,12 @@ def target(request, build_id, target_id): | |||
| 388 | return render(request, template, context) | 412 | return render(request, template, context) |
| 389 | 413 | ||
| 390 | 414 | ||
| 415 | def _find_task_dep(task): | ||
| 416 | tp = [] | ||
| 417 | for p in Task_Dependency.objects.filter(task=task): | ||
| 418 | tp.append(p.depends_on); | ||
| 419 | return tp | ||
| 420 | |||
| 391 | 421 | ||
| 392 | def _find_task_revdep(task): | 422 | def _find_task_revdep(task): |
| 393 | tp = [] | 423 | tp = [] |
