From 0997e377d267fed418659ff233eaf8fe89f1e66f Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 27 Aug 2019 21:56:03 +0200 Subject: [PATCH] [DEV] add return value from execution --- island/__init__.py | 3 ++- island/actions.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/island/__init__.py b/island/__init__.py index 21f53f7..9cf86b4 100755 --- a/island/__init__.py +++ b/island/__init__.py @@ -213,8 +213,9 @@ if action_to_do != "init" \ exit(-1) -actions.execute(action_to_do, my_args.get_last_parsed()+1) +ret = actions.execute(action_to_do, my_args.get_last_parsed()+1) +exit (ret) # stop all started threads; #multiprocess.un_init() diff --git a/island/actions.py b/island/actions.py index 19fe3cd..6a66c39 100644 --- a/island/actions.py +++ b/island/actions.py @@ -131,9 +131,10 @@ def execute(action_name, argument_start_id): ret = the_action.execute(my_under_args) if ret == None: return 0 - debug.info(" ==========================") - debug.info(" == Some error occured ==") - debug.info(" ==========================") + if ret < 0: + debug.info(" ==========================") + debug.info(" == Some error occured ==") + debug.info(" ==========================") return ret debug.error("Can not do the action...") return -10