From 14bbcfe3651636d206c77d6535d54a2b54101fc4 Mon Sep 17 00:00:00 2001 From: Florent 'Skia' Jacquet Date: Tue, 4 Mar 2025 17:08:47 +0100 Subject: [PATCH] Replace a wrong usage of 'distro_info' by a simpler static list Just for sharing a snippet, here would be the correct usage of `distro_info`: ```python import distro_info d = distro_info.UbuntuDistroInfo() x = d.get_all() x.index("xenial") < x.index("noble") ``` --- britney2/policies/autopkgtest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 62c7cdb..e20a951 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -38,7 +38,6 @@ from urllib.error import HTTPError from urllib.request import urlopen import apt_pkg -import distro_info import britney2.hints @@ -849,7 +848,7 @@ class AutopkgtestPolicy(BasePolicy): try: # Filter tests to main packages on riscv64 for Noble+ if arch == "riscv64": - if self.options.series >= distro_info.UbuntuDistroInfo().codename("noble"): + if self.options.series not in ["focal", "jammy"]: tests = [(src, version) for (src, version) in tests if sources_info[src].component == UbuntuComponent.MAIN] else: tests = []