Compare commits

...

2 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
a99508a6b2
distupgrade: Update Trixie's release date as announced
Tests:

- Distribution upgrade page shows the updated date.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-08-01 20:00:40 -04:00
Sunil Mohan Adapa
30432aa9b6
distupgrade: Handle comments in sources.list file
Tests:

- Add a comment and /etc/apt/sources.list file. Distribution upgrade page does
not load and fails with an error.

- With the patch, page loads properly. Distribution upgrade can be triggered.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Fix test for release date]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-08-01 20:00:32 -04:00
2 changed files with 5 additions and 2 deletions

View File

@ -46,7 +46,7 @@ distribution_info: dict = {
'trixie': { 'trixie': {
'version': 13, 'version': 13,
'next': 'forky', 'next': 'forky',
'release_date': datetime.datetime(2025, 8, 20, tzinfo=timezone.utc), 'release_date': datetime.datetime(2025, 8, 9, tzinfo=timezone.utc),
}, },
'forky': { 'forky': {
'version': 14, 'version': 14,
@ -116,6 +116,9 @@ def _get_sources_list_codename() -> str | None:
dists = set() dists = set()
for match_ in aug.match('*'): for match_ in aug.match('*'):
dist = aug.get(match_ + '/distribution') dist = aug.get(match_ + '/distribution')
if not dist:
continue
dist = dist.removesuffix('-updates') dist = dist.removesuffix('-updates')
dist = dist.removesuffix('-security') dist = dist.removesuffix('-security')
dists.add(dist) dists.add(dist)

View File

@ -190,7 +190,7 @@ def test_get_status(check_auto, is_dist_upgrade_enabled,
assert status['current_release_date'] == current_date assert status['current_release_date'] == current_date
assert status['next_codename'] == 'trixie' assert status['next_codename'] == 'trixie'
assert status['next_version'] == 13 assert status['next_version'] == 13
next_date = datetime_original(2025, 8, 20, tzinfo=timezone.utc) next_date = datetime_original(2025, 8, 9, tzinfo=timezone.utc)
assert status['next_release_date'] == next_date assert status['next_release_date'] == next_date
assert status['next_action'] == 'manual' assert status['next_action'] == 'manual'