diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-09-05 18:10:37 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-05 11:19:25 +0200 |
commit | 5422db82e3c250add94357a4371c3db31b220be4 (patch) | |
tree | 9bf914ba9089d52457ee8e3f77074f71d1f9c214 /source4 | |
parent | 1afeb4e391c99fa3513d460d3a8f08d9609f5a7e (diff) | |
download | samba-5422db82e3c250add94357a4371c3db31b220be4.tar.gz samba-5422db82e3c250add94357a4371c3db31b220be4.tar.bz2 samba-5422db82e3c250add94357a4371c3db31b220be4.zip |
s4-s3-upgrade Fix error handling in add_users_to_group
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/upgrade.py | 7 |
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): |