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:
@ -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)
|
||||
|
Reference in New Issue
Block a user