summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/netcmd
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-06-19 12:43:08 +0200
committerJelmer Vernooij <jelmer@samba.org>2012-06-21 18:05:33 +0200
commitcbd660d01381465a35dc696b6a135de22f7682e6 (patch)
tree9ab54901865002a4c36735accb0e04def259af2e /source4/scripting/python/samba/netcmd
parent3c74117e2eb6616b8f539807ae8824d963f7987c (diff)
downloadsamba-cbd660d01381465a35dc696b6a135de22f7682e6.tar.gz
samba-cbd660d01381465a35dc696b6a135de22f7682e6.tar.xz
samba-cbd660d01381465a35dc696b6a135de22f7682e6.zip
samdb: Accept a list of member variables rather than a comma-separated string.
Diffstat (limited to 'source4/scripting/python/samba/netcmd')
-rw-r--r--source4/scripting/python/samba/netcmd/group.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/netcmd/group.py b/source4/scripting/python/samba/netcmd/group.py
index 0f4a744acc..42c236bc95 100644
--- a/source4/scripting/python/samba/netcmd/group.py
+++ b/source4/scripting/python/samba/netcmd/group.py
@@ -206,7 +206,9 @@ Example2 shows how to add a single user account, User2, to the supergroup AD gro
try:
samdb = SamDB(url=H, session_info=system_session(),
credentials=creds, lp=lp)
- samdb.add_remove_group_members(groupname, listofmembers, add_members_operation=True)
+ groupmembers = listofmembers.split(',')
+ samdb.add_remove_group_members(groupname, groupmembers,
+ add_members_operation=True)
except Exception, e:
# FIXME: catch more specific exception
raise CommandError('Failed to add members "%s" to group "%s"' % (
@@ -256,7 +258,8 @@ Example2 shows how to remove a single user account, User2, from the supergroup A
try:
samdb = SamDB(url=H, session_info=system_session(),
credentials=creds, lp=lp)
- samdb.add_remove_group_members(groupname, listofmembers, add_members_operation=False)
+ samdb.add_remove_group_members(groupname, listofmembers.split(","),
+ add_members_operation=False)
except Exception, e:
# FIXME: Catch more specific exception
raise CommandError('Failed to remove members "%s" from group "%s"' % (listofmembers, groupname), e)