Tim Andersson has proposed merging 
~andersson123/autopkgtest-cloud:update-github-jobs-fix 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/455864
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of 
~andersson123/autopkgtest-cloud:update-github-jobs-fix into 
autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-web/webcontrol/update-github-jobs b/charms/focal/autopkgtest-web/webcontrol/update-github-jobs
index 6362803..f198132 100755
--- a/charms/focal/autopkgtest-web/webcontrol/update-github-jobs
+++ b/charms/focal/autopkgtest-web/webcontrol/update-github-jobs
@@ -17,13 +17,19 @@ from request.submit import Submit
 PENDING_DIR = "/run/autopkgtest_webcontrol/github-pending"
 swift_url = None
 external_url = None
+SWIFT_OBJECTS = ["log.gz", "artifacts.tar.gz", "result.tar"]
 
 
 def result_matches_job(result_url, params):
     # download result.tar and get exit code and testinfo
+    if not any(ele in result_url for ele in SWIFT_OBJECTS):
+        result_url += "/result.tar"
+    elif "result.tar" not in result_url:
+        return
+
     for _ in range(5):
         try:
-            with urllib.request.urlopen(result_url + "/result.tar") as f:
+            with urllib.request.urlopen(result_url) as f:
                 tar_bytes = io.BytesIO(f.read())
             break
         except IOError as e:
@@ -130,6 +136,7 @@ def process_job(jobfile):
     }
     args["marker"] = args["prefix"] + timestamp
     query_url = container_url + "?" + urllib.parse.urlencode(args)
+    print(query_url)
     logging.debug("Swift URL query: %s", query_url)
     try:
         with urllib.request.urlopen(query_url) as f:
-- 
Mailing list: https://launchpad.net/~canonical-ubuntu-qa
Post to     : canonical-ubuntu-qa@lists.launchpad.net
Unsubscribe : https://launchpad.net/~canonical-ubuntu-qa
More help   : https://help.launchpad.net/ListHelp

Reply via email to