summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-09-09 13:22:27 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-09-09 15:24:04 +1000
commitb2a7fe166c95ef5d5f5b6af76303cc8d456ac816 (patch)
tree0a54ae94394951530dd09a5b11abbb92f5d1b1cc /source4/scripting
parentabd7368e769f7e378594f44e569ef69e7bd626c9 (diff)
downloadsamba-b2a7fe166c95ef5d5f5b6af76303cc8d456ac816.tar.gz
samba-b2a7fe166c95ef5d5f5b6af76303cc8d456ac816.tar.bz2
samba-b2a7fe166c95ef5d5f5b6af76303cc8d456ac816.zip
samba-tool: Correctly handle sys.exit() called from subcommand
Catch SystemExit exception if any subcommand calls sys.exit() and return with failure (-1). Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/bin/samba-tool4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/scripting/bin/samba-tool b/source4/scripting/bin/samba-tool
index 2e92041076..c191865152 100755
--- a/source4/scripting/bin/samba-tool
+++ b/source4/scripting/bin/samba-tool
@@ -77,6 +77,8 @@ if __name__ == '__main__':
try:
retval = cmd._run("samba-tool", subcommand, *args)
- sys.exit(retval)
+ except SystemExit, e:
+ retval = -1
except Exception, e:
cmd.show_command_error(e)
+ sys.exit(retval)