From 5db66569ad2864979d20377f124ea0dfcac45c8d Mon Sep 17 00:00:00 2001 From: Oleksandr Liemieshko Date: Wed, 2 Nov 2016 13:55:03 -0700 Subject: [PATCH] Fix: timmy exits 0 on unhandled exceptions Change-Id: I734b3ba22c7e9ddfd3f8621cd3925a87f5130cf4 --- doc/source/exitcodes.rst | 1 + timmy/tools.py | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/source/exitcodes.rst b/doc/source/exitcodes.rst index fea0620..3057ed1 100644 --- a/doc/source/exitcodes.rst +++ b/doc/source/exitcodes.rst @@ -16,3 +16,4 @@ Exit Codes * `110` - unable to create a directory. * `111` - ip address must be defined for Node instance. * `112` - one of the two parameters **fuel_user** or **fuel_pass** specified without the other. +* `113` - unhandled Python exception occured in main process. diff --git a/timmy/tools.py b/timmy/tools.py index 71f1e1a..2e5d8dd 100644 --- a/timmy/tools.py +++ b/timmy/tools.py @@ -62,6 +62,7 @@ def interrupt_wrapper(f): if not k.startswith('__') and k != 'message': v = getattr(e, k) logger.debug('Error details: %s = %s' % (k, v)) + sys.exit(113) return wrapper