Re: [Freeipa-devel] [PATCH 0075] Ensure users exist when assigning tokens to them
On 13.11.2014 16:19, Petr Vobornik wrote: On 13.11.2014 07:51, Nathaniel McCallum wrote: On Mon, 2014-11-10 at 08:36 +0100, Jan Cholasta wrote: Hi, Dne 24.10.2014 v 22:21 Nathaniel McCallum napsal(a): https://fedorahosted.org/freeipa/ticket/4642 please use "userobj.handle_not_found(owner)" instead of raising NotFound manually. Fixed. and also ACK :) Pushed to: master: c38e2d7394522a4b4f98f9d7e1ce234fa3be985f ipa-4-1: 2c1d40bf1f649edb82eafb29b7ce62a922e051f6 -- Petr Vobornik ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH 0075] Ensure users exist when assigning tokens to them
On 13.11.2014 07:51, Nathaniel McCallum wrote: On Mon, 2014-11-10 at 08:36 +0100, Jan Cholasta wrote: Hi, Dne 24.10.2014 v 22:21 Nathaniel McCallum napsal(a): https://fedorahosted.org/freeipa/ticket/4642 please use "userobj.handle_not_found(owner)" instead of raising NotFound manually. Fixed. Pushed to: master: c38e2d7394522a4b4f98f9d7e1ce234fa3be985f ipa-4-1: 2c1d40bf1f649edb82eafb29b7ce62a922e051f6 -- Petr Vobornik ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH 0075] Ensure users exist when assigning tokens to them
On Mon, 2014-11-10 at 08:36 +0100, Jan Cholasta wrote: > Hi, > > Dne 24.10.2014 v 22:21 Nathaniel McCallum napsal(a): > > https://fedorahosted.org/freeipa/ticket/4642 > > please use "userobj.handle_not_found(owner)" instead of raising NotFound > manually. Fixed. From 620444f2878d0b83e528f4fdb6089d437c758fa4 Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Fri, 24 Oct 2014 16:16:50 -0400 Subject: [PATCH] Ensure users exist when assigning tokens to them https://fedorahosted.org/freeipa/ticket/4642 --- ipalib/plugins/otptoken.py | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py index 2b5f1c5fb83341d392e165a3507f5076820f1d3a..f6cb62a5e8e44593373a4b9b0dd01bd4955f24f0 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: -- 2.1.0 ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH 0075] Ensure users exist when assigning tokens to them
Hi, Dne 24.10.2014 v 22:21 Nathaniel McCallum napsal(a): https://fedorahosted.org/freeipa/ticket/4642 please use "userobj.handle_not_found(owner)" instead of raising NotFound manually. Honza -- Jan Cholasta ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
[Freeipa-devel] [PATCH 0075] Ensure users exist when assigning tokens to them
https://fedorahosted.org/freeipa/ticket/4642 From a5126724da30536210ce0399001d68e8e52778b3 Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Fri, 24 Oct 2014 16:16:50 -0400 Subject: [PATCH] Ensure users exist when assigning tokens to them https://fedorahosted.org/freeipa/ticket/4642 --- ipalib/plugins/otptoken.py | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py index 2b5f1c5fb83341d392e165a3507f5076820f1d3a..460204022939b6e945d04000c6ee4cef1bf327b1 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: +raise NotFound(reason=_('User %s not found') % owner) def _check_interval(not_before, not_after): if not_before and not_after: -- 2.1.0 ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel