git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
abd7368
)
samba-tool: Correctly handle sys.exit() called from subcommand
author
Amitay Isaacs
<amitay@gmail.com>
Fri, 9 Sep 2011 03:22:27 +0000
(13:22 +1000)
committer
Andrew Bartlett
<abartlet@samba.org>
Fri, 9 Sep 2011 05:24:04 +0000
(15:24 +1000)
Catch SystemExit exception if any subcommand calls sys.exit()
and return with failure (-1).
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/bin/samba-tool
patch
|
blob
|
history
diff --git
a/source4/scripting/bin/samba-tool
b/source4/scripting/bin/samba-tool
index 2e920410768edd8f30c751fece02f931d332e6b7..c191865152157b9aeae83de3332a7dd11a43f441 100755
(executable)
--- 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)