mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
bullseye->bookworm: trigger the 'new' migration from inside the bullseye->bookworm migration
This commit is contained in:
parent
67d6baa151
commit
f11f11973b
1 changed files with 14 additions and 0 deletions
|
@ -4,7 +4,9 @@ import subprocess
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from moulinette import Moulinette, m18n
|
from moulinette import Moulinette, m18n
|
||||||
|
from moulinette.utils.process import call_async_output
|
||||||
from yunohost.utils.error import YunohostError
|
from yunohost.utils.error import YunohostError
|
||||||
|
from yunohost.tools import _write_migration_state
|
||||||
from moulinette.utils.process import check_output
|
from moulinette.utils.process import check_output
|
||||||
from moulinette.utils.filesystem import read_file, write_to_file
|
from moulinette.utils.filesystem import read_file, write_to_file
|
||||||
|
|
||||||
|
@ -230,6 +232,18 @@ class MyMigration(Migration):
|
||||||
if apps_packages:
|
if apps_packages:
|
||||||
aptitude_with_progress_bar(f"unhold {' '.join(apps_packages)}")
|
aptitude_with_progress_bar(f"unhold {' '.join(apps_packages)}")
|
||||||
|
|
||||||
|
# Mark this migration as completed before triggering the "new" migrations
|
||||||
|
_write_migration_state(self.id, "done")
|
||||||
|
|
||||||
|
callbacks = (
|
||||||
|
lambda l: logger.debug("+ " + l.rstrip() + "\r"),
|
||||||
|
lambda l: logger.warning(l.rstrip()),
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
call_async_output(["yunohost", "tools", "migrations", "run"], callbacks)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(e)
|
||||||
|
|
||||||
# If running from the webadmin, restart the API after a delay
|
# If running from the webadmin, restart the API after a delay
|
||||||
if Moulinette.interface.type == "api":
|
if Moulinette.interface.type == "api":
|
||||||
logger.warning(m18n.n("migration_0027_delayed_api_restart"))
|
logger.warning(m18n.n("migration_0027_delayed_api_restart"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue