1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-20 08:59:06 +03:00

pynet: Raise proper exceptions rather than invoking sys.exit.

This commit is contained in:
Jelmer Vernooij
2010-05-19 00:26:56 +02:00
parent d18fbda0d0
commit ac9341245a
2 changed files with 6 additions and 8 deletions

View File

@ -22,7 +22,6 @@
import samba.getopt as options
from samba.netcmd import Command, CommandError, Option
import sys
from getpass import getpass
from samba.auth import system_session
from samba.samdb import SamDB
@ -73,6 +72,5 @@ class cmd_setpassword(Command):
force_change_at_next_login=must_change_at_next_login,
username=username)
except:
print('Failed to set password for user "%s"' % username)
sys.exit(1)
raise CommandError('Failed to set password for user "%s"' %
username)