diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 4e8f69e801..784272fd70 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -2710,7 +2710,6 @@ if True: | |||
2710 | 2710 | ||
2711 | def build_artifact(request, build_id, artifact_type, artifact_id): | 2711 | def build_artifact(request, build_id, artifact_type, artifact_id): |
2712 | if artifact_type in ["cookerlog"]: | 2712 | if artifact_type in ["cookerlog"]: |
2713 | # these artifacts are saved after building, so they are on the server itself | ||
2714 | def _mimetype_for_artifact(path): | 2713 | def _mimetype_for_artifact(path): |
2715 | try: | 2714 | try: |
2716 | import magic | 2715 | import magic |
@@ -2741,16 +2740,16 @@ if True: | |||
2741 | except ImportError: | 2740 | except ImportError: |
2742 | return "binary/octet-stream" | 2741 | return "binary/octet-stream" |
2743 | try: | 2742 | try: |
2744 | # match code with runbuilds.Command.archive() | 2743 | build = Build.objects.get(pk = build_id) |
2745 | build_artifact_storage_dir = os.path.join(ToasterSetting.objects.get(name="ARTIFACTS_STORAGE_DIR").value, "%d" % int(build_id)) | 2744 | file_name = build.cooker_log_path |
2746 | file_name = os.path.join(build_artifact_storage_dir, "cooker_log.txt") | ||
2747 | |||
2748 | fsock = open(file_name, "r") | 2745 | fsock = open(file_name, "r") |
2749 | content_type=_mimetype_for_artifact(file_name) | 2746 | content_type = _mimetype_for_artifact(file_name) |
2750 | 2747 | ||
2751 | response = HttpResponse(fsock, content_type = content_type) | 2748 | response = HttpResponse(fsock, content_type = content_type) |
2752 | 2749 | ||
2753 | response['Content-Disposition'] = 'attachment; filename=' + os.path.basename(file_name) | 2750 | disposition = 'attachment; filename=cooker.log' |
2751 | response['Content-Disposition'] = disposition | ||
2752 | |||
2754 | return response | 2753 | return response |
2755 | except IOError: | 2754 | except IOError: |
2756 | context = { | 2755 | context = { |