[enh] Warn user about unbackup/unrestored apps

This commit is contained in:
kload 2014-10-26 01:05:18 +02:00
parent 7ab1e67a94
commit fe9ee97774
2 changed files with 14 additions and 2 deletions

View file

@ -53,8 +53,12 @@ def backup_backup():
try:
for app_id in os.listdir('/etc/yunohost/apps'):
hook = '/etc/yunohost/apps/'+ app_id +'/scripts/backup'
with open(hook, 'r') as f:
if os.path.isfile(hook):
hook_add(app_id, hook)
else:
msignals.display(m18n.n('unbackup_app', app_id),
'warning')
except IOError:
pass
@ -91,6 +95,8 @@ def backup_restore(path):
try:
with open('/etc/yunohost/installed') as f:
#raise MoulinetteError(errno.EINVAL, m18n.n('yunohost_already_installed'))
msignals.display(m18n.n('restoring_installed_system'), 'warning')
time.sleep(5)
pass
except IOError:
tools_postinstall(domain, 'yunohost', True)
@ -99,8 +105,11 @@ def backup_restore(path):
try:
for app_id in os.listdir('/etc/yunohost/apps'):
hook = '/etc/yunohost/apps/'+ app_id +'/scripts/restore'
with open(hook, 'r') as f:
if os.path.isfile(hook):
hook_add(app_id, hook)
else:
msignals.display(m18n.n('unrestore_app', app_id),
'warning')
except IOError:
pass

View file

@ -131,6 +131,9 @@
"backup_complete" : "Backup complete",
"invalid_restore_package" : "Invalid restore package",
"restore_complete" : "Restore complete",
"restoring_installed_system" : "You are trying to restore a backup on an already installed system, abort unless you know what you are doing!",
"unbackup_app" : "'{:s}' will NOT be saved",
"unrestore_app" : "'{:s}' will NOT be restored",
"field_invalid" : "Invalid field '{:s}'",
"mail_domain_unknown" : "Unknown mail address domain '{:s}'",