summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMarc Muehlfeld <mmuehlfeld@samba.org>2014-10-12 16:32:08 +0200
committerMichael Adam <obnox@samba.org>2014-10-23 15:56:04 +0200
commit4ab6df622c81363b8acb31113016ecfbbe1ec5c4 (patch)
treeeb2a63ea13a6fb072015913a0e0a6790669ba7fd /python
parent1c7b81e76824ce78ecc5d700b76b8a68b1beb1bd (diff)
downloadsamba-4ab6df622c81363b8acb31113016ecfbbe1ec5c4.tar.gz
samba-4ab6df622c81363b8acb31113016ecfbbe1ec5c4.tar.xz
samba-4ab6df622c81363b8acb31113016ecfbbe1ec5c4.zip
samba-tool: Add exception when trying to add/remove none existent users from a group.
This allows a better scripting around samba-tool for adding/removing users to/from groups. Before the output and the return code had indicated that everything was successul. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10871 Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/samdb.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/samba/samdb.py b/python/samba/samdb.py
index 2dfc839519..e6d99bc037 100644
--- a/python/samba/samdb.py
+++ b/python/samba/samdb.py
@@ -260,7 +260,7 @@ changetype: modify
ldb.binary_encode(member), ldb.binary_encode(member)), attrs=[])
if len(targetmember) != 1:
- continue
+ raise Exception('Unable to find "%s". Operation cancelled.' % member)
if add_members_operation is True and (targetgroup[0].get('member') is None or str(targetmember[0].dn) not in targetgroup[0]['member']):
modified = True