From edf96bc77864235c896dc2178f059059741b1b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Fri, 6 May 2016 23:37:41 +0200 Subject: [PATCH] [enh] Also add app hooks after successful upgrade --- src/yunohost/app.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 9a4214409..a9d41800a 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -386,12 +386,6 @@ def app_upgrade(auth, app=[], url=None, file=None): status = _get_app_status(app_instance_name) status['remote'] = manifest.get('remote', None) - # Clean hooks and add new ones - hook_remove(app_instance_name) - if 'hooks' in os.listdir(app_tmp_folder): - for hook in os.listdir(app_tmp_folder +'/hooks'): - hook_add(app_instance_name, app_tmp_folder +'/hooks/'+ hook) - # Retrieve arguments list for upgrade script # TODO: Allow to specify arguments args_odict = _parse_args_from_manifest(manifest, 'upgrade', auth=auth) @@ -415,6 +409,12 @@ def app_upgrade(auth, app=[], url=None, file=None): app_setting(app_instance_name, 'update_time', now) status['upgraded_at'] = now + # Clean hooks and add new ones + hook_remove(app_instance_name) + if 'hooks' in os.listdir(app_tmp_folder): + for hook in os.listdir(app_tmp_folder +'/hooks'): + hook_add(app_instance_name, app_tmp_folder +'/hooks/'+ hook) + # Store app status with open(app_setting_path + '/status.json', 'w+') as f: json.dump(status, f)