From f3750598e3f5a7c8b68f4a8059dd4a4568cfc227 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 27 Oct 2022 16:20:08 +0200 Subject: [PATCH] global setting: make sure to run migration 25 prior to the regenconf --- src/tools.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tools.py b/src/tools.py index 4af6273c9..add1451b1 100644 --- a/src/tools.py +++ b/src/tools.py @@ -277,6 +277,16 @@ def tools_postinstall( def tools_regen_conf( names=[], with_diff=False, force=False, dry_run=False, list_pending=False ): + + # Make sure the settings are migrated before running the migration, + # which may otherwise fuck things up such as the ssh config ... + # We do this here because the regen-conf is called before the migration in debian/postinst + if os.path.exists("/etc/yunohost/settings.json") and not os.path.exists("/etc/yunohost/settings.yml"): + try: + tools_migrations_run(["0025_global_settings_to_configpanel"]) + except Exception as e: + logger.error(e) + return regen_conf(names, with_diff, force, dry_run, list_pending)