mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Allow the migration to proceed if slapd config was manually modified, warn the user about where the conf will be backuped
This commit is contained in:
parent
795cae1a4b
commit
96bc95656c
2 changed files with 3 additions and 3 deletions
|
@ -346,7 +346,7 @@
|
||||||
"migration_0011_can_not_backup_before_migration": "The backup of the system before the migration failed. Migration failed. Error: {error:s}",
|
"migration_0011_can_not_backup_before_migration": "The backup of the system before the migration failed. Migration failed. Error: {error:s}",
|
||||||
"migration_0011_create_group": "Creating a group for each user…",
|
"migration_0011_create_group": "Creating a group for each user…",
|
||||||
"migration_0011_done": "Migration successful. You are now able to manage usergroups.",
|
"migration_0011_done": "Migration successful. You are now able to manage usergroups.",
|
||||||
"migration_0011_LDAP_config_dirty": "It look like that you customized your LDAP configuration. For this migration the LDAP configuration needs to be updated.\nYou need to save your current configuration, reintialize the original configuration by running 'yunohost tools regen-conf -f' and retry the migration",
|
"migration_0011_slapd_config_will_be_overwritten": "It looks like you manually edited the slapd configuration. For this critical migration, YunoHost needs to force the update of the slapd configuration. The original files will be backuped in {conf_backup_folder}.",
|
||||||
"migration_0011_LDAP_update_failed": "Could not update LDAP. Error: {error:s}",
|
"migration_0011_LDAP_update_failed": "Could not update LDAP. Error: {error:s}",
|
||||||
"migration_0011_migrate_permission": "Migrating permissions from apps settings to LDAP…",
|
"migration_0011_migrate_permission": "Migrating permissions from apps settings to LDAP…",
|
||||||
"migration_0011_migration_failed_trying_to_rollback": "Migration failed… trying to roll back the system.",
|
"migration_0011_migration_failed_trying_to_rollback": "Migration failed… trying to roll back the system.",
|
||||||
|
|
|
@ -9,7 +9,7 @@ from moulinette.utils.filesystem import read_yaml
|
||||||
from yunohost.tools import Migration
|
from yunohost.tools import Migration
|
||||||
from yunohost.user import user_group_create, user_group_update
|
from yunohost.user import user_group_create, user_group_update
|
||||||
from yunohost.app import app_setting, app_list
|
from yunohost.app import app_setting, app_list
|
||||||
from yunohost.regenconf import regen_conf
|
from yunohost.regenconf import regen_conf, BACKUP_CONF_DIR
|
||||||
from yunohost.permission import permission_create, user_permission_update, permission_sync_to_user
|
from yunohost.permission import permission_create, user_permission_update, permission_sync_to_user
|
||||||
|
|
||||||
logger = getActionLogger('yunohost.migration')
|
logger = getActionLogger('yunohost.migration')
|
||||||
|
@ -130,7 +130,7 @@ class MyMigration(Migration):
|
||||||
ldap_regen_conf_status = regen_conf(names=['slapd'], dry_run=True)
|
ldap_regen_conf_status = regen_conf(names=['slapd'], dry_run=True)
|
||||||
# By this we check if the have been customized
|
# By this we check if the have been customized
|
||||||
if ldap_regen_conf_status and ldap_regen_conf_status['slapd']['pending']:
|
if ldap_regen_conf_status and ldap_regen_conf_status['slapd']['pending']:
|
||||||
raise YunohostError("migration_0011_LDAP_config_dirty")
|
logger.warning("migration_0011_slapd_config_will_be_overwritten", conf_backup_folder=BACKUP_CONF_DIR)
|
||||||
|
|
||||||
# Backup LDAP and the apps settings before to do the migration
|
# Backup LDAP and the apps settings before to do the migration
|
||||||
logger.info(m18n.n("migration_0011_backup_before_migration"))
|
logger.info(m18n.n("migration_0011_backup_before_migration"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue