From: Loic Dachary Date: Thu, 13 Nov 2014 18:14:49 +0000 (+0100) Subject: tests: ceph_objectstore_tool.py main returns X-Git-Tag: v0.90~81^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0f3d7b1315f2b5595047d8bd13949ed0d9194bfa;p=ceph.git tests: ceph_objectstore_tool.py main returns Instead of calling sys.exit() the main function returns the desired exit code. Signed-off-by: Loic Dachary --- diff --git a/src/test/ceph_objectstore_tool.py b/src/test/ceph_objectstore_tool.py index 95375143cd54f..8ce2ac8d9e167 100755 --- a/src/test/ceph_objectstore_tool.py +++ b/src/test/ceph_objectstore_tool.py @@ -268,7 +268,7 @@ def main(argv): ret = call(cmd, shell=True, stderr=nullfd) if ret != 0: logging.critical("Replicated pool object creation failed with {ret}".format(ret=ret)) - sys.exit(1) + return 1 db[nspace][NAME] = {} @@ -345,7 +345,7 @@ def main(argv): ret = call(cmd, shell=True, stderr=nullfd) if ret != 0: logging.critical("Erasure coded pool creation failed with {ret}".format(ret=ret)) - sys.exit(1) + return 1 db[nspace][NAME] = {} @@ -376,7 +376,7 @@ def main(argv): if ERRORS: logging.critical("Unable to set up test") - sys.exit(1) + return 1 ALLREPPGS = get_pgs(OSDDIR, REPID) logging.debug(ALLREPPGS) @@ -706,7 +706,7 @@ def main(argv): ret = call(cmd, shell=True, stdout=tmpfd) if ret: logging.critical("INTERNAL ERROR") - sys.exit(1) + return 1 tmpfd.close() obj_locs = get_lines(TMPFILE) if len(obj_locs) == 0: @@ -761,10 +761,11 @@ def main(argv): if ERRORS == 0: print "TEST PASSED" - sys.exit(0) + return 0 else: print "TEST FAILED WITH {errcount} ERRORS".format(errcount=ERRORS) - sys.exit(1) + return 1 if __name__ == "__main__": - main(sys.argv[1:]) + status = main(sys.argv[1:]) + sys.exit(status)