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

s4-samba-tool: give a bit better error on user delete failure

This commit is contained in:
Andrew Tridgell
2011-04-01 15:59:15 +11:00
parent f0e7303023
commit bf3a75cf82

View File

@ -24,6 +24,7 @@ from samba.net import Net
from samba.netcmd import (
Command,
CommandError,
SuperCommand,
)
@ -64,7 +65,10 @@ class cmd_user_delete(Command):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp, fallback_machine=True)
net = Net(creds, lp, server=credopts.ipaddress)
net.delete_user(name)
try:
net.delete_user(name)
except RuntimeError, msg:
raise CommandError("Failed to delete user %s: %s" % (name, msg))
class cmd_user(SuperCommand):