[enh] journal on app remove

This commit is contained in:
Laurent Peuch 2016-06-24 08:25:20 +02:00
parent d159a437f6
commit de7d26521b

View file

@ -812,6 +812,7 @@ def app_remove(auth, app):
"""
from yunohost.hook import hook_exec, hook_remove
from yunohost.journals import Journal
if not _is_installed(app):
raise MoulinetteError(errno.EINVAL,
@ -837,7 +838,8 @@ def app_remove(auth, app):
env_dict["YNH_APP_INSTANCE_NAME"] = app
env_dict["YNH_APP_INSTANCE_NUMBER"] = str(app_instance_nb)
if hook_exec('/tmp/yunohost_remove/scripts/remove', args=args_list, env=env_dict, user="root") == 0:
journal = Journal(["remove", app], "app", args=args_list, env=env_dict)
if hook_exec('/tmp/yunohost_remove/scripts/remove', args=args_list, env=env_dict, user="root", journal=journal) == 0:
logger.success(m18n.n('app_removed', app=app))
if os.path.exists(app_setting_path):