Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:amend_json_parsing 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/447925 -- Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:amend_json_parsing 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 1e31008..eefac44 100644 --- a/charms/focal/autopkgtest-web/webcontrol/request/submit.py +++ b/charms/focal/autopkgtest-web/webcontrol/request/submit.py @@ -552,19 +552,22 @@ class Submit: releases = data[pkg][submitted].keys() for release in data[pkg][submitted]: architectures = data[pkg][submitted][release].keys() - triggers = submitted[submitted.find(";triggers_") + 1 :] - triggers = triggers[: triggers.find(";")] - triggers = triggers[ - triggers.find("[") + 1 : triggers.find("]") - ] - triggers = triggers.replace("'", "").split(", ") - if ( - req_arch in architectures - and req_series in releases - and req_package == pkg - and sorted(triggers) == sorted(req_triggers) - ): - return True + for arch in architectures: + triggers = [] + if ( + "triggers" + in data[pkg][submitted][release][arch][0].keys() + ): + triggers = data[pkg][submitted][release][arch][0][ + "triggers" + ] + if ( + req_arch in architectures + and req_series in releases + and req_package == pkg + and sorted(triggers) == sorted(req_triggers) + ): + return True return False def is_test_in_queue( @@ -590,10 +593,9 @@ class Submit: for req in packages["requests"]: pkg = req[: req.find("{")].rstrip() details = json.loads(req[req.find("{") :]) - try: + triggers = [] + if "triggers" in details.keys(): triggers = details["triggers"] - except KeyError: - triggers = [] test = { "release": release, "arch": arch,
-- 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