summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-07-21 12:32:53 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-28 15:20:52 +1000
commit48d905f281af80e0d0dd0269a72fecdf05aeb1be (patch)
tree3e6d411ebba6ff9c09bcba24844c366b272c1bbd /source4
parente79040cc720c18cce11731f5140411b40d7dad68 (diff)
downloadsamba-48d905f281af80e0d0dd0269a72fecdf05aeb1be.tar.gz
samba-48d905f281af80e0d0dd0269a72fecdf05aeb1be.tar.xz
samba-48d905f281af80e0d0dd0269a72fecdf05aeb1be.zip
samba-tool: Catch exceptions at top-level and exit with correct return value
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/scripting/bin/samba-tool6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/scripting/bin/samba-tool b/source4/scripting/bin/samba-tool
index f220b82fd98..c24c0e38dbc 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)