mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
Convert uniqueMember members into DN objects.
We were asserting that they should be DN objects but weren't converting them anywhere. https://fedorahosted.org/freeipa/ticket/3339
This commit is contained in:
parent
cfe18944d6
commit
746181a88d
@ -244,7 +244,13 @@ def _pre_migrate_group(ldap, pkey, dn, entry_attrs, failed, config, ctx, **kwarg
|
||||
new_members = []
|
||||
entry_attrs.setdefault(member_attr, [])
|
||||
for m in entry_attrs[member_attr]:
|
||||
assert isinstance(m, DN)
|
||||
try:
|
||||
m = DN(m)
|
||||
except ValueError, e:
|
||||
# This should be impossible unless the remote server
|
||||
# doesn't enforce syntax checking.
|
||||
api.log.error('Malformed DN %s: %s' % (m, e))
|
||||
continue
|
||||
try:
|
||||
rdnval = m[0].value
|
||||
except IndexError:
|
||||
@ -252,10 +258,10 @@ def _pre_migrate_group(ldap, pkey, dn, entry_attrs, failed, config, ctx, **kwarg
|
||||
continue
|
||||
|
||||
if m.endswith(search_bases['user']):
|
||||
api.log.info('migrating user %s' % m)
|
||||
api.log.info('migrating %s user %s' % (member_attr, m))
|
||||
m = DN((api.Object.user.primary_key.name, rdnval), api.env.container_user)
|
||||
elif m.endswith(search_bases['group']):
|
||||
api.log.info('migrating group %s' % m)
|
||||
api.log.info('migrating %s group %s' % (member_attr, m))
|
||||
m = DN((api.Object.group.primary_key.name, rdnval), api.env.container_group)
|
||||
else:
|
||||
api.log.error('entry %s does not belong into any known container' % m)
|
||||
|
Loading…
Reference in New Issue
Block a user