bullseye->bookworm: add a trick to flag the migration as done if it's still marked as pending

This commit is contained in:
Alexandre Aubin 2024-07-31 00:06:33 +02:00
parent eb1d715764
commit 0503a38a74

View file

@ -671,6 +671,15 @@ def tools_migrations_run(
raise YunohostValidationError("migrations_no_such_migration", id=target)
# Dirty hack to mark the bullseye->bookworm as done ...
# it may still be marked as 'pending' if for some reason the migration crashed,
# but the admins ran 'apt full-upgrade' to manually finish the migration
# ... in which case it won't be magically flagged as 'done' until here
migrate_to_bookworm = get_matching_migration("migrate_to_bookworm")
if migrate_to_bookworm.state == "pending":
migrate_to_bookworm.state = "done"
_write_migration_state(migrate_to_bookworm.id, "done")
# auto, skip and force are exclusive options
if auto + skip + force_rerun > 1:
raise YunohostValidationError("migrations_exclusive_options")