diff options
author | Csaba Henk <csaba@gluster.com> | 2011-04-13 01:46:02 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-04-13 04:42:53 -0700 |
commit | 9a81400a4accc68bfe55a0bee69ca7e2ed5894f3 (patch) | |
tree | 322c8dd32c54afea5c62a6cb73e5a3e0af15c25d | |
parent | 64161529ebe151e36c7fc86b419543b4ac02a681 (diff) |
syncdaemon: return exit code properly
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 1570 (geosync related changes)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/gsyncd.py | 9 |
1 files 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: |