From 5027ec0468b242713a4f28d03bc0fa5f5177bf3e Mon Sep 17 00:00:00 2001 From: opi Date: Tue, 3 May 2016 16:42:04 +0200 Subject: [PATCH] [fix] Pass app instance environment variables to remove script. --- src/yunohost/app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 19929f501..157917a96 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -608,7 +608,13 @@ def app_remove(auth, app): args_list = [app] - if hook_exec('/tmp/yunohost_remove/scripts/remove', args_list) == 0: + env_dict = {} + app_id, app_instance_nb = _parse_app_instance_name(app) + env_dict["YNH_APP_ID"] = app_id + 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) == 0: logger.success(m18n.n('app_removed', app=app)) if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path)