diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-24 00:44:41 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-24 00:44:41 +0000 |
commit | f3aaf65f1c4bbee31dae9431423ab88a15eba990 (patch) | |
tree | 46ddafec983e8337b014e3c9fcda59d7bb6071a3 /ipalib/plugable.py | |
parent | 81de10f176437053ac47bfee8f5ec81e38f2cf57 (diff) | |
download | freeipa-f3aaf65f1c4bbee31dae9431423ab88a15eba990.tar.gz freeipa-f3aaf65f1c4bbee31dae9431423ab88a15eba990.tar.xz freeipa-f3aaf65f1c4bbee31dae9431423ab88a15eba990.zip |
320: plugable.API now respects the Plugin.__proxy__ flag; added test for plugins without proxy to unit tests for API
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r-- | ipalib/plugable.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 6e12d5c79..f883eb12e 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -241,6 +241,7 @@ class Plugin(ReadOnly): Base class for all plugins. """ __public__ = frozenset() + __proxy__ = True __api = None def __get_name(self): @@ -709,7 +710,10 @@ class API(DictProxy): if klass not in instances: instances[klass] = klass() plugin = instances[klass] - yield PluginProxy(base, plugin) + if base.__proxy__: + yield PluginProxy(base, plugin) + else: + yield plugin for name in self.register: base = self.register[name] |