aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ipsutils/task.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipsutils/task.py b/ipsutils/task.py
index 9ae4d7e..2c1ccec 100644
--- a/ipsutils/task.py
+++ b/ipsutils/task.py
@@ -29,7 +29,7 @@ class Controller(object):
"""
self.stack.append(t)
- def do_tasks(self):
+ def do_tasks(self, atexit=None):
""" FILO execution of tasks
"""
if not self.stack:
@@ -40,11 +40,15 @@ class Controller(object):
if type(status) == type(True):
if not status:
print("Internal error: {}".format(status))
+ if atexit is not None:
+ atexit()
exit(status)
else:
if status is not 0 \
and status is not None:
print("exit: {}".format(status))
+ if atexit is not None:
+ atexit()
exit(status)
class Task(object):