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 authored and Petr Vobornik committed 2014-11-13 16:18:41 +01:00
1 parent 93ff9ec087
commit c38e2d7394
1 file changed
+5 -2
+5 -2
View File
@@ -100,8 +100,11 @@ def _convert_owner(userobj, entry_attrs, options):
def _normalize_owner(userobj, entry_attrs):
owner = entry_attrs.get('ipatokenowner', None)
if owner is not None:
entry_attrs['ipatokenowner'] = userobj.get_dn(owner)
if owner:
try:
entry_attrs['ipatokenowner'] = userobj._normalize_manager(owner)[0]
except NotFound:
userobj.handle_not_found(owner)
def _check_interval(not_before, not_after):
if not_before and not_after: