Ensure users exist when assigning tokens to them

https://fedorahosted.org/freeipa/ticket/4642

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Nathaniel McCallum 2014-10-24 16:16:50 -04:00 committed by Petr Vobornik
parent 93ff9ec087
commit c38e2d7394

View File

@ -100,8 +100,11 @@ def _convert_owner(userobj, entry_attrs, options):
def _normalize_owner(userobj, entry_attrs): def _normalize_owner(userobj, entry_attrs):
owner = entry_attrs.get('ipatokenowner', None) owner = entry_attrs.get('ipatokenowner', None)
if owner is not None: if owner:
entry_attrs['ipatokenowner'] = userobj.get_dn(owner) try:
entry_attrs['ipatokenowner'] = userobj._normalize_manager(owner)[0]
except NotFound:
userobj.handle_not_found(owner)
def _check_interval(not_before, not_after): def _check_interval(not_before, not_after):
if not_before and not_after: if not_before and not_after: