From 9a81400a4accc68bfe55a0bee69ca7e2ed5894f3 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Wed, 13 Apr 2011 01:46:02 +0000 Subject: syncdaemon: return exit code properly Signed-off-by: Csaba Henk Signed-off-by: Anand Avati BUG: 1570 (geosync related changes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570 --- xlators/features/marker/utils/syncdaemon/gsyncd.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py index 2ce11a8aa39..140a8283d6c 100644 --- a/xlators/features/marker/utils/syncdaemon/gsyncd.py +++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py @@ -168,10 +168,13 @@ def main(): try: main_i() except: - exc = sys.exc_info()[0] - if exc != SystemExit: + exc = sys.exc_info()[1] + if isinstance(exc, SystemExit): + exval = exc.code or 0 + raise + else: logging.exception("FAIL: ") - sys.stderr.write("failed with %s.\n" % exc.__name__) + sys.stderr.write("failed with %s.\n" % type(exc).__name__) exval = 1 sys.exit(exval) finally: -- cgit