mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fixes following rebase
This commit is contained in:
parent
2dd1d8ccfe
commit
e97b07403f
2 changed files with 5 additions and 6 deletions
|
@ -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")
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue