canonical-ubuntu-qa team mailing list archive
-
canonical-ubuntu-qa team
-
Mailing list archive
-
Message #02007
[Merge] ~andersson123/autopkgtest-cloud:improve-private-results-response into autopkgtest-cloud:master
Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:improve-private-results-response into autopkgtest-cloud:master.
Requested reviews:
Canonical's Ubuntu QA (canonical-ubuntu-qa)
For more details, see:
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/456466
--
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:improve-private-results-response into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-web/webcontrol/private_results/app.py b/charms/focal/autopkgtest-web/webcontrol/private_results/app.py
index 9ae1e89..8dec905 100644
--- a/charms/focal/autopkgtest-web/webcontrol/private_results/app.py
+++ b/charms/focal/autopkgtest-web/webcontrol/private_results/app.py
@@ -41,7 +41,12 @@ LOGIN = """
</form>
"""
-DENIED = "Unprivileged or unavailable."
+DENIED_ACC = "Unprivileged! You can't access these logs."
+
+DENIED_OBJ = (
+ "Denied! The result couldn't be acquired. Please speak "
+ + "to a member of the Canonical Ubuntu QA team."
+)
def swift_get_object(connection, container, path):
@@ -151,11 +156,11 @@ def index_result(container, series, arch, group, src, runid, file):
object_path = os.path.join(parent_path, file)
acl_path = os.path.join(parent_path, "readable-by")
if not validate_user_path(connection, container, nick, acl_path):
- return render_template_string(HTML, content=DENIED), 403
+ return render_template_string(HTML, content=DENIED_ACC), 403
# We can pull the result now
result = swift_get_object(connection, container, object_path)
if result is None:
- return render_template_string(HTML, content=DENIED), 403
+ return render_template_string(HTML, content=DENIED_OBJ), 404
if file.endswith(".gz"):
content_type = "text/plain; charset=UTF-8"
headers = {"Content-Encoding": "gzip"}