summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-04-01 15:59:15 +1100
committerAndrew Tridgell <tridge@samba.org>2011-04-04 10:30:30 +1000
commitbf3a75cf82f7ccdde14108d0d300b08d764277a3 (patch)
treec60421c7e93739f5d4d3c73fcd262b31320abcc8 /source4/scripting/python
parentf0e73030239d29654eb54ebc95c636ff6385d575 (diff)
downloadsamba-bf3a75cf82f7ccdde14108d0d300b08d764277a3.tar.gz
samba-bf3a75cf82f7ccdde14108d0d300b08d764277a3.tar.bz2
samba-bf3a75cf82f7ccdde14108d0d300b08d764277a3.zip
s4-samba-tool: give a bit better error on user delete failure
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/netcmd/user.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py
index bbc972bcc7..a5750b5010 100644
--- a/source4/scripting/python/samba/netcmd/user.py
+++ b/source4/scripting/python/samba/netcmd/user.py
@@ -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):