[Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-25 Thread Ondrej Hamada
https://fedorahosted.org/freeipa/ticket/1336 Lazy initialization of ipalib plugins is used under all contexts, not only when context = cli. Every loaded plugin is pre-finalized - a flag is set, which means, that the plugin needs to be finalized. Then every call of plugin's __gettattr__ checks

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-25 Thread Martin Kosek
On Tue, 2011-10-25 at 15:29 +0200, Ondrej Hamada wrote: > https://fedorahosted.org/freeipa/ticket/1336 > > Lazy initialization of ipalib plugins is used under all contexts, not > only when context = cli. Every loaded plugin is pre-finalized - a flag > is set, which means, that the plugin needs t

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-25 Thread Ondrej Hamada
On 10/25/2011 04:01 PM, Martin Kosek wrote: On Tue, 2011-10-25 at 15:29 +0200, Ondrej Hamada wrote: https://fedorahosted.org/freeipa/ticket/1336 Lazy initialization of ipalib plugins is used under all contexts, not only when context = cli. Every loaded plugin is pre-finalized - a flag is set, w

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-25 Thread Rob Crittenden
Ondrej Hamada wrote: On 10/25/2011 04:01 PM, Martin Kosek wrote: On Tue, 2011-10-25 at 15:29 +0200, Ondrej Hamada wrote: https://fedorahosted.org/freeipa/ticket/1336 Lazy initialization of ipalib plugins is used under all contexts, not only when context = cli. Every loaded plugin is pre-finali

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-26 Thread Jan Cholasta
Dne 25.10.2011 22:30, Rob Crittenden napsal(a): Ondrej Hamada wrote: On 10/25/2011 04:01 PM, Martin Kosek wrote: On Tue, 2011-10-25 at 15:29 +0200, Ondrej Hamada wrote: https://fedorahosted.org/freeipa/ticket/1336 Lazy initialization of ipalib plugins is used under all contexts, not only when

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-26 Thread Martin Kosek
On Wed, 2011-10-26 at 11:39 +0200, Jan Cholasta wrote: > Dne 25.10.2011 22:30, Rob Crittenden napsal(a): > > Ondrej Hamada wrote: > >> On 10/25/2011 04:01 PM, Martin Kosek wrote: > >>> On Tue, 2011-10-25 at 15:29 +0200, Ondrej Hamada wrote: > https://fedorahosted.org/freeipa/ticket/1336 >

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-26 Thread Jan Cholasta
Dne 26.10.2011 15:41, Martin Kosek napsal(a): On Wed, 2011-10-26 at 11:39 +0200, Jan Cholasta wrote: Dne 25.10.2011 22:30, Rob Crittenden napsal(a): Ondrej Hamada wrote: On 10/25/2011 04:01 PM, Martin Kosek wrote: On Tue, 2011-10-25 at 15:29 +0200, Ondrej Hamada wrote: https://fedorahosted.o

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-26 Thread Martin Kosek
On Wed, 2011-10-26 at 15:52 +0200, Jan Cholasta wrote: > Dne 26.10.2011 15:41, Martin Kosek napsal(a): > > On Wed, 2011-10-26 at 11:39 +0200, Jan Cholasta wrote: > >> Dne 25.10.2011 22:30, Rob Crittenden napsal(a): > >>> Ondrej Hamada wrote: > On 10/25/2011 04:01 PM, Martin Kosek wrote: >

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-26 Thread Jan Cholasta
Dne 26.10.2011 16:39, Martin Kosek napsal(a): On Wed, 2011-10-26 at 15:52 +0200, Jan Cholasta wrote: Dne 26.10.2011 15:41, Martin Kosek napsal(a): On Wed, 2011-10-26 at 11:39 +0200, Jan Cholasta wrote: Dne 25.10.2011 22:30, Rob Crittenden napsal(a): Ondrej Hamada wrote: On 10/25/2011 04:01 P

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-31 Thread Jan Cholasta
Dne 26.10.2011 16:50, Jan Cholasta napsal(a): Dne 26.10.2011 16:39, Martin Kosek napsal(a): On Wed, 2011-10-26 at 15:52 +0200, Jan Cholasta wrote: Dne 26.10.2011 15:41, Martin Kosek napsal(a): On Wed, 2011-10-26 at 11:39 +0200, Jan Cholasta wrote: Dne 25.10.2011 22:30, Rob Crittenden napsal(a

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-31 Thread Alexander Bokovoy
On Mon, 31 Oct 2011, Jan Cholasta wrote: > Added finalization for __call__ and the check for CLI. Patch attached. ACK from my side but see below. > +def __getattribute__(self, name): > +if not name.startswith('_Plugin__') and not > name.startswith('_ReadOnly__') and name != 'finalize_

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-31 Thread Simo Sorce
On Mon, 2011-10-31 at 14:19 +0200, Alexander Bokovoy wrote: > On Mon, 31 Oct 2011, Jan Cholasta wrote: > > Added finalization for __call__ and the check for CLI. Patch attached. > ACK from my side but see below. > > > +def __getattribute__(self, name): > > +if not name.startswith('_Plu

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-31 Thread Alexander Bokovoy
On Mon, 31 Oct 2011, Simo Sorce wrote: > On Mon, 2011-10-31 at 14:19 +0200, Alexander Bokovoy wrote: > > On Mon, 31 Oct 2011, Jan Cholasta wrote: > > > Added finalization for __call__ and the check for CLI. Patch attached. > > ACK from my side but see below. > > > > > +def __getattribute__(sel

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-10-31 Thread Jan Cholasta
Dne 31.10.2011 13:19, Alexander Bokovoy napsal(a): On Mon, 31 Oct 2011, Jan Cholasta wrote: Added finalization for __call__ and the check for CLI. Patch attached. ACK from my side but see below. +def __getattribute__(self, name): +if not name.startswith('_Plugin__') and not name.

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-02 Thread Alexander Bokovoy
On Mon, 31 Oct 2011, Jan Cholasta wrote: > Dne 31.10.2011 13:19, Alexander Bokovoy napsal(a): > >On Mon, 31 Oct 2011, Jan Cholasta wrote: > >>Added finalization for __call__ and the check for CLI. Patch attached. > >ACK from my side but see below. > > > >>+def __getattribute__(self, name): > >>

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-02 Thread Martin Kosek
On Wed, 2011-11-02 at 12:42 +0200, Alexander Bokovoy wrote: > On Mon, 31 Oct 2011, Jan Cholasta wrote: > > Dne 31.10.2011 13:19, Alexander Bokovoy napsal(a): > > >On Mon, 31 Oct 2011, Jan Cholasta wrote: > > >>Added finalization for __call__ and the check for CLI. Patch attached. > > >ACK from my s

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-02 Thread Alexander Bokovoy
On Wed, 02 Nov 2011, Martin Kosek wrote: > Hmm, this looks impressive! It would brings us considerably faster CLI > calls. > > And again, I would feel much safer if we do these optimizations only > for CLI and let server do all the initialization right on start. Well, that could be done in API.fi

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-02 Thread Jan Cholasta
Dne 2.11.2011 11:42, Alexander Bokovoy napsal(a): On Mon, 31 Oct 2011, Jan Cholasta wrote: Dne 31.10.2011 13:19, Alexander Bokovoy napsal(a): On Mon, 31 Oct 2011, Jan Cholasta wrote: Added finalization for __call__ and the check for CLI. Patch attached. ACK from my side but see below. +

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-02 Thread Alexander Bokovoy
On Wed, 02 Nov 2011, Jan Cholasta wrote: > I see a number of problems with the patch: > > * Only Command subclasses are finalized (that might be the reason > why it is so fast) > * You assume that the first operation on a plugin instance is a > call on the args/options/params namespaces, but t

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-02 Thread Jan Cholasta
Dne 2.11.2011 16:11, Alexander Bokovoy napsal(a): On Wed, 02 Nov 2011, Jan Cholasta wrote: I see a number of problems with the patch: * Only Command subclasses are finalized (that might be the reason why it is so fast) * You assume that the first operation on a plugin instance is a call o

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-02 Thread Alexander Bokovoy
On Wed, 02 Nov 2011, Jan Cholasta wrote: > >Callable instances are a consequence of the above -- > >Command.__call__() does use properties that are changed due to > >finalize() being run. In fact, there are so many places in FreeIPA > >where we simply expect that foo.args/params/output_params/outpu

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-02 Thread Alexander Bokovoy
(actual patch attached!) On Wed, 02 Nov 2011, Alexander Bokovoy wrote: > On Wed, 02 Nov 2011, Jan Cholasta wrote: > > >Callable instances are a consequence of the above -- > > >Command.__call__() does use properties that are changed due to > > >finalize() being run. In fact, there are so many plac

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-03 Thread Martin Kosek
On Wed, 2011-11-02 at 18:38 +0200, Alexander Bokovoy wrote: > (actual patch attached!) > > On Wed, 02 Nov 2011, Alexander Bokovoy wrote: > > On Wed, 02 Nov 2011, Jan Cholasta wrote: > > > >Callable instances are a consequence of the above -- > > > >Command.__call__() does use properties that are c

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-03 Thread Alexander Bokovoy
On Thu, 03 Nov 2011, Martin Kosek wrote: > Good, this indeed addresses all my previous concerns but one :-) > > $ ./makeapi > Writing API to API.txt > Traceback (most recent call last): > File "./makeapi", line 392, in > sys.exit(main()) > File "./makeapi", line 376, in main > rval |

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-03 Thread Jan Cholasta
Dne 2.11.2011 17:38, Alexander Bokovoy napsal(a): (actual patch attached!) On Wed, 02 Nov 2011, Alexander Bokovoy wrote: On Wed, 02 Nov 2011, Jan Cholasta wrote: Callable instances are a consequence of the above -- Command.__call__() does use properties that are changed due to finalize() being

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-03 Thread Alexander Bokovoy
On Thu, 03 Nov 2011, Jan Cholasta wrote: > The problem with the API class is that it creates all the plugin > instances every time. Both mine and your patch don't change that, > they deal only with finalization, which is the easier part of the > lazy initialization problem. Additionally, in your pa

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-09 Thread Jan Cholasta
Dne 3.11.2011 12:43, Alexander Bokovoy napsal(a): On Thu, 03 Nov 2011, Jan Cholasta wrote: The problem with the API class is that it creates all the plugin instances every time. Both mine and your patch don't change that, they deal only with finalization, which is the easier part of the lazy ini

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-09 Thread Alexander Bokovoy
On Wed, 09 Nov 2011, Jan Cholasta wrote: > >>would't suffer from a facelift - currently it is messy, hard to read > >>code, with bits nobody ever used or uses anymore, some of the > >>docstrings and comments aren't correct, etc.) > >A review of API class is a good idea. However, I think it is curre

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-09 Thread Jan Cholasta
Dne 9.11.2011 11:59, Alexander Bokovoy napsal(a): On Wed, 09 Nov 2011, Jan Cholasta wrote: would't suffer from a facelift - currently it is messy, hard to read code, with bits nobody ever used or uses anymore, some of the docstrings and comments aren't correct, etc.) A review of API class is a

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-15 Thread Rob Crittenden
Jan Cholasta wrote: Dne 9.11.2011 11:59, Alexander Bokovoy napsal(a): On Wed, 09 Nov 2011, Jan Cholasta wrote: would't suffer from a facelift - currently it is messy, hard to read code, with bits nobody ever used or uses anymore, some of the docstrings and comments aren't correct, etc.) A revi

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-21 Thread Jan Cholasta
Dne 15.11.2011 20:10, Rob Crittenden napsal(a): Jan Cholasta wrote: Dne 9.11.2011 11:59, Alexander Bokovoy napsal(a): On Wed, 09 Nov 2011, Jan Cholasta wrote: would't suffer from a facelift - currently it is messy, hard to read code, with bits nobody ever used or uses anymore, some of the docs

Re: [Freeipa-devel] [PATCH] 1 Do lazy initializiation ipalib

2011-11-22 Thread Rob Crittenden
Jan Cholasta wrote: Dne 15.11.2011 20:10, Rob Crittenden napsal(a): Jan Cholasta wrote: Dne 9.11.2011 11:59, Alexander Bokovoy napsal(a): On Wed, 09 Nov 2011, Jan Cholasta wrote: would't suffer from a facelift - currently it is messy, hard to read code, with bits nobody ever used or uses anym