From e97b07403f72b772ba557e9ed4b41e7e15df2e71 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 12 Dec 2018 13:23:53 +0000 Subject: [PATCH] Fixes following rebase --- .../0007_ssh_conf_managed_by_yunohost_step1.py | 6 +++--- .../0008_ssh_conf_managed_by_yunohost_step2.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/yunohost/data_migrations/0007_ssh_conf_managed_by_yunohost_step1.py b/src/yunohost/data_migrations/0007_ssh_conf_managed_by_yunohost_step1.py index 73cb162b6..306e47672 100644 --- a/src/yunohost/data_migrations/0007_ssh_conf_managed_by_yunohost_step1.py +++ b/src/yunohost/data_migrations/0007_ssh_conf_managed_by_yunohost_step1.py @@ -4,7 +4,6 @@ import re from shutil import copyfile from moulinette import m18n -from moulinette.core import MoulinetteError from moulinette.utils.log import getActionLogger from moulinette.utils.filesystem import mkdir, rm @@ -12,6 +11,7 @@ from yunohost.tools import Migration from yunohost.service import service_regen_conf, _get_conf_hashes, \ _calculate_hash, _run_service_command from yunohost.settings import settings_set +from yunohost.utils.error import YunohostError logger = getActionLogger('yunohost.migration') @@ -67,11 +67,11 @@ class MyMigration(Migration): # Restart ssh and backward if it fail if not _run_service_command('restart', 'ssh'): self.backward() - raise MoulinetteError(m18n.n("migration_0007_cancel")) + raise YunohostError("migration_0007_cancel") def backward(self): # We don't backward completely but it should be enough copyfile('/etc/ssh/sshd_config.bkp', SSHD_CONF) if not _run_service_command('restart', 'ssh'): - raise MoulinetteError(m18n.n("migration_0007_cannot_restart")) + raise YunohostError("migration_0007_cannot_restart") diff --git a/src/yunohost/data_migrations/0008_ssh_conf_managed_by_yunohost_step2.py b/src/yunohost/data_migrations/0008_ssh_conf_managed_by_yunohost_step2.py index c53154192..5d8fee89c 100644 --- a/src/yunohost/data_migrations/0008_ssh_conf_managed_by_yunohost_step2.py +++ b/src/yunohost/data_migrations/0008_ssh_conf_managed_by_yunohost_step2.py @@ -1,13 +1,12 @@ import re -from moulinette import m18n -from moulinette.core import MoulinetteError from moulinette.utils.log import getActionLogger from yunohost.tools import Migration from yunohost.service import service_regen_conf, _get_conf_hashes, \ _calculate_hash from yunohost.settings import settings_set, settings_get +from yunohost.utils.error import YunohostError logger = getActionLogger('yunohost.migration') @@ -33,7 +32,7 @@ class MyMigration(Migration): def backward(self): - raise MoulinetteError(m18n.n("migration_0008_backward_impossible")) + raise YunohostError("migration_0008_backward_impossible") @property def mode(self):