From: Stefan Metzmacher Date: Tue, 11 Sep 2012 06:21:27 +0000 (+0200) Subject: s4:samba-tool: allow sys.exit(ret) to control the exit code X-Git-Tag: samba-4.0.0rc1~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=475755ef9ff5f39ba499de8f30c23efcce10ba0c;p=thirdparty%2Fsamba.git s4:samba-tool: allow sys.exit(ret) to control the exit code Some subcommands may use sys.exit(0), which shouldn't be reported as an error to the caller. metze --- diff --git a/source4/scripting/bin/samba-tool b/source4/scripting/bin/samba-tool index c4ea8141666..8ec6514bbf5 100755 --- a/source4/scripting/bin/samba-tool +++ b/source4/scripting/bin/samba-tool @@ -36,7 +36,7 @@ if len(sys.argv) > 1: try: retval = cmd._run("samba-tool", subcommand, *args) except SystemExit, e: - retval = -1 + retval = e.code except Exception, e: cmd.show_command_error(e) retval = 1