summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/upgrade.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py
index 58be9919ff..7b0c062ce1 100644
--- a/source4/scripting/python/samba/upgrade.py
+++ b/source4/scripting/python/samba/upgrade.py
@@ -207,8 +207,11 @@ def add_users_to_group(samdb, group, members, logger):
try:
samdb.modify(m)
- except ldb.LdbError, e:
- logger.warn("Could not add member to group '%s'", groupmap.nt_name)
+ except ldb.LdbError, (ecode, emsg):
+ if ecode == ldb.ERR_NO_SUCH_OBJECT:
+ logger.warn("Could not add member '%s' to group '%s' as either group or user record doesn't exist: %s", member_sid, group.sid, emsg)
+ else:
+ logger.warn("Could not add member '%s' to group '%s': %s", member_sid, group.sid, emsg)
def import_wins(samba4_winsdb, samba3_winsdb):