diff options
author | Nathaniel McCallum <npmccallum@redhat.com> | 2014-10-24 16:16:50 -0400 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-11-13 16:18:41 +0100 |
commit | c38e2d7394522a4b4f98f9d7e1ce234fa3be985f (patch) | |
tree | a76eb26a70a13545ea2c8b7a3d3eb629f35bfac8 /ipalib | |
parent | 93ff9ec087854012d6ccb521d17981f4d25e5c23 (diff) | |
download | freeipa-c38e2d7394522a4b4f98f9d7e1ce234fa3be985f.tar.gz freeipa-c38e2d7394522a4b4f98f9d7e1ce234fa3be985f.tar.xz freeipa-c38e2d7394522a4b4f98f9d7e1ce234fa3be985f.zip |
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>
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/otptoken.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py index 77366bafe..f48feeee0 100644 --- a/ipalib/plugins/otptoken.py +++ b/ipalib/plugins/otptoken.py @@ -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: |