samba-tool: Catch exceptions at top-level and exit with correct return value
authorAmitay Isaacs <amitay@gmail.com>
Thu, 21 Jul 2011 02:32:53 +0000 (12:32 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 28 Jul 2011 05:20:52 +0000 (15:20 +1000)
Signed-off-by: Andrew Tridgell <tridge@samba.org>
source4/scripting/bin/samba-tool

index f220b82fd984b221ec726f3342ab063f45f4b9e2..c24c0e38dbc2124051eef376b744e4d14dd4d167 100755 (executable)
@@ -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)