From 48d905f281af80e0d0dd0269a72fecdf05aeb1be Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Thu, 21 Jul 2011 12:32:53 +1000 Subject: samba-tool: Catch exceptions at top-level and exit with correct return value Signed-off-by: Andrew Tridgell --- source4/scripting/bin/samba-tool | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/scripting/bin/samba-tool') diff --git a/source4/scripting/bin/samba-tool b/source4/scripting/bin/samba-tool index f220b82fd9..c24c0e38db 100755 --- a/source4/scripting/bin/samba-tool +++ b/source4/scripting/bin/samba-tool @@ -70,4 +70,8 @@ if __name__ == '__main__': if len(sys.argv) > 2: args = sys.argv[2:] - cmd._run("samba-tool.py", command, *args) + try: + retval = cmd._run("samba-tool", command, *args) + sys.exit(retval) + except Exception as e: + cmd.show_command_error(e) -- cgit