From 7f9d45bf10d36b1b443305e0f2e79cb448b98cbd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Jul 2011 10:29:21 +1000 Subject: samba-tool: make sure we exit with an error on a bad command Pair-Programmed-With: Andrew Bartlett Autobuild-User: Andrew Tridgell Autobuild-Date: Thu Jul 21 04:58:01 CEST 2011 on sn-devel-104 --- source4/scripting/python/samba/netcmd/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/scripting/python') 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: -- cgit