diff options
author | Amitay Isaacs <amitay@gmail.com> | 2011-09-09 13:22:27 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-09 15:24:04 +1000 |
commit | b2a7fe166c95ef5d5f5b6af76303cc8d456ac816 (patch) | |
tree | 0a54ae94394951530dd09a5b11abbb92f5d1b1cc /source4/scripting/bin/samba-tool | |
parent | abd7368e769f7e378594f44e569ef69e7bd626c9 (diff) | |
download | samba-b2a7fe166c95ef5d5f5b6af76303cc8d456ac816.tar.gz |
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/bin/samba-tool')
-rwxr-xr-x | source4/scripting/bin/samba-tool | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/scripting/bin/samba-tool b/source4/scripting/bin/samba-tool index 2e920410768..c1918651521 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) |