From c5f34880143608c87e9188db6e9e59f291c56d51 Mon Sep 17 00:00:00 2001 From: Alexis Gavoty Date: Thu, 19 Dec 2013 13:50:32 +0100 Subject: [PATCH] Do not fail at hook removal (fixes #57) --- yunohost_hook.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yunohost_hook.py b/yunohost_hook.py index c7666768..14b719ee 100644 --- a/yunohost_hook.py +++ b/yunohost_hook.py @@ -66,10 +66,12 @@ def hook_remove(app): app -- Scripts related to app will be removed """ - for action in os.listdir(hook_folder): - for script in os.listdir(hook_folder + action): - if script.endswith(app): - os.remove(hook_folder + action +'/'+ script) + try: + for action in os.listdir(hook_folder): + for script in os.listdir(hook_folder + action): + if script.endswith(app): + os.remove(hook_folder + action +'/'+ script) + except OSError: pass def hook_callback(action, args=None):