diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-07-21 10:29:21 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-07-21 04:58:01 +0200 |
commit | 7f9d45bf10d36b1b443305e0f2e79cb448b98cbd (patch) | |
tree | 85f6d31d6425b3e32abdf33b32e57757760004fe /source4/scripting | |
parent | 6e82e208312c5a2dd870459041b9f2d756ab9ac9 (diff) | |
download | samba-7f9d45bf10d36b1b443305e0f2e79cb448b98cbd.tar.gz samba-7f9d45bf10d36b1b443305e0f2e79cb448b98cbd.tar.bz2 samba-7f9d45bf10d36b1b443305e0f2e79cb448b98cbd.zip |
samba-tool: make sure we exit with an error on a bad command
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Jul 21 04:58:01 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/netcmd/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py index e5d20ef301..f8371e7a7d 100644 --- a/source4/scripting/python/samba/netcmd/__init__.py +++ b/source4/scripting/python/samba/netcmd/__init__.py @@ -82,6 +82,7 @@ class Command(object): if force_traceback or samba.get_debug_level() >= 3: traceback.print_tb(etraceback) + sys.exit(1) outf = sys.stdout @@ -171,7 +172,7 @@ class SuperCommand(Command): '''display a command error''' print >>sys.stderr, "ERROR: %s" % (msg) - return -1 + sys.exit(1) def usage(self, myname, subcommand=None, *args): if subcommand is None or not subcommand in self.subcommands: |