]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:samba-tool: allow sys.exit(ret) to control the exit code
authorStefan Metzmacher <metze@samba.org>
Tue, 11 Sep 2012 06:21:27 +0000 (08:21 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 11 Sep 2012 06:23:55 +0000 (08:23 +0200)
Some subcommands may use sys.exit(0), which shouldn't be reported
as an error to the caller.

metze

source4/scripting/bin/samba-tool

index c4ea8141666ca70c771954d1800a911aa08f54d2..8ec6514bbf5e93860fc897fcafad36e6939547c8 100755 (executable)
@@ -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