plugable: initialize plugins on demand

Use a new API namespace class which does not initialize plugins until they
are accessed.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta
2016-06-08 14:38:23 +02:00
parent bebdce89b6
commit 4128c565ea
5 changed files with 74 additions and 34 deletions

View File

@@ -87,7 +87,7 @@ class DummyCommand(object):
class DummyAPI(object):
def __init__(self, cnt):
self.__cmd = plugable.NameSpace(self.__cmd_iter(cnt))
self.__cmd = plugable.APINameSpace(self.__cmd_iter(cnt), DummyCommand)
def __get_cmd(self):
return self.__cmd