← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] ~andersson123/autopkgtest-cloud:fix_duplicate_git_req into autopkgtest-cloud:master

 

Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:fix_duplicate_git_req 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/453063
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:fix_duplicate_git_req into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-web/webcontrol/request/submit.py b/charms/focal/autopkgtest-web/webcontrol/request/submit.py
index 94ad34b..6d2408d 100644
--- a/charms/focal/autopkgtest-web/webcontrol/request/submit.py
+++ b/charms/focal/autopkgtest-web/webcontrol/request/submit.py
@@ -567,6 +567,8 @@ class Submit:
         with open(RUNNING_FP, "r") as f:
             data = json.load(f)
         for pkg in data:
+            if pkg != req_package:
+                continue
             for submitted in data[pkg]:
                 releases = data[pkg][submitted].keys()
                 for release in data[pkg][submitted]:
@@ -578,7 +580,7 @@ class Submit:
                         running_all_proposed = "all-proposed_1" in submitted
                         req_all_proposed = "all-proposed" in kwargs.keys()
                         git_same = False
-                        if git:
+                        if git and "build-git" in submitted:
                             build_git_url = data[pkg][submitted][release][
                                 arch
                             ][0].get("build-git", [])
@@ -624,6 +626,8 @@ class Submit:
             for release in data[test_type]:
                 for arch in data[test_type][release]:
                     packages = data[test_type][release][arch]
+                    if req_package not in packages:
+                        continue
                     if packages["size"] != 0:
                         for req in packages["requests"]:
                             pkg = req[: req.find("{")].rstrip()
@@ -644,7 +648,7 @@ class Submit:
                                 "triggers": sorted(triggers),
                             }
                             git_same = False
-                            if git:
+                            if git and "build-git" in details:
                                 build_git_url = details.get("build-git", [])
                                 ppas = details.get("ppas", [])
                                 env = details.get("env", [])

References