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")
```
This commit is contained in:
Florent 'Skia' Jacquet 2025-03-04 17:08:47 +01:00
parent a0bf23fba0
commit 14bbcfe365

View File

@ -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 = []