bitbake: toastergui: make artifact download more robust

When an artifact download is requested, Toaster goes through a
convoluted series of conditions to decide which file to push
to the response. In the case of build artifact downloads for
command line builds, this caused an ugly exception, as command
line builds don't have a build request.

To simplify and catch more corner cases, remove the code which
fetches files via the build environment (we only support the local
build environment anyway). Then push all requests along a single
path, catching any missing file errors, missing object errors
or poorly-formed URLs in a single except clause which always returns
a valid response.

Also modify the text on the "unavailable artifact" page so it
says that the artifact doesn't exist, rather than it "no longer"
exists (exceptions may occur because an invalid artifact was
requested, rather than an artifact which was removed).

[YOCTO #7603]

(Bitbake rev: 24e20db55c2933de5e58ca754b8fd5b624f47820)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Elliot Smith
2016-01-18 15:45:10 +02:00
committed by Richard Purdie
parent 68f3e1e067
commit f98e11c809
2 changed files with 47 additions and 63 deletions

View File

@@ -3,15 +3,14 @@
{% load humanize %}
{% load static %}
{% block title %} Build artifact no longer exists - Toaster {% endblock %}
{% block title %} Build artifact does not exist - Toaster {% endblock %}
{% block pagecontent %}
<div class="row-fluid air">
<div class="alert alert-info span8 lead">
<p"> The build artifact you are trying to download no longer exists.</p>
<p><a href="javascript:window.history.back()">Back to previous page</a></p>
<div class="row-fluid air">
<div class="alert alert-info span8 lead">
<p>The build artifact you are trying to download does not exist.</p>
<p><a href="javascript:window.history.back()">Back to previous page</a></p>
</div>
</div>
</div>
{% endblock %}