mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Add mode, description and optionnal disclaimer for migrations
This commit is contained in:
parent
020dea6531
commit
7f359e363b
2 changed files with 16 additions and 3 deletions
|
@ -222,6 +222,8 @@
|
||||||
"migrate_tsig_wait_3": "1min...",
|
"migrate_tsig_wait_3": "1min...",
|
||||||
"migrate_tsig_wait_4": "30 secondes...",
|
"migrate_tsig_wait_4": "30 secondes...",
|
||||||
"migrate_tsig_not_needed": "You do not appear to use a dyndns domain, so no migration is needed !",
|
"migrate_tsig_not_needed": "You do not appear to use a dyndns domain, so no migration is needed !",
|
||||||
|
"migration_description_0001_change_cert_group_to_sslcert": "Change certificates group permissions from 'metronome' to 'ssl-cert'",
|
||||||
|
"migration_description_0002_migrate_to_tsig_sha256": "Improve security of dyndns TSIG by using SHA512 instead of MD5",
|
||||||
"migrations_backward": "Migrating backward.",
|
"migrations_backward": "Migrating backward.",
|
||||||
"migrations_bad_value_for_target": "Invalide number for target argument, available migrations numbers are 0 or {}",
|
"migrations_bad_value_for_target": "Invalide number for target argument, available migrations numbers are 0 or {}",
|
||||||
"migrations_cant_reach_migration_file": "Can't access migrations files at path %s",
|
"migrations_cant_reach_migration_file": "Can't access migrations files at path %s",
|
||||||
|
|
|
@ -950,10 +950,9 @@ def _load_migration(migration_file):
|
||||||
|
|
||||||
class Migration(object):
|
class Migration(object):
|
||||||
|
|
||||||
# forward() and backward() are to be implemented by daughter classes
|
# Those are to be implemented by daughter classes
|
||||||
|
|
||||||
def migrate(self):
|
mode = "auto"
|
||||||
self.forward()
|
|
||||||
|
|
||||||
def forward(self):
|
def forward(self):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
@ -961,15 +960,27 @@ class Migration(object):
|
||||||
def backward(self):
|
def backward(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def disclaimer(self):
|
||||||
|
return None
|
||||||
|
|
||||||
# The followings shouldn't be overriden
|
# The followings shouldn't be overriden
|
||||||
|
|
||||||
|
def migrate(self):
|
||||||
|
self.forward()
|
||||||
|
|
||||||
def __init__(self, id_):
|
def __init__(self, id_):
|
||||||
self.id = id_
|
self.id = id_
|
||||||
|
|
||||||
|
def description(self):
|
||||||
|
return m18n.n("migration_description_%s" % self.id)
|
||||||
|
|
||||||
def infos(self):
|
def infos(self):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"id": self.id,
|
"id": self.id,
|
||||||
"number": int(self.id.split("_", 1)[0]),
|
"number": int(self.id.split("_", 1)[0]),
|
||||||
"name": self.id.split("_", 1)[1],
|
"name": self.id.split("_", 1)[1],
|
||||||
|
"mode": self.mode,
|
||||||
|
"description": self.description(),
|
||||||
|
"disclaimer": self.disclaimer()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue