summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2011-11-03 06:42:17 -0400
committerRob Crittenden <rcritten@redhat.com>2011-11-22 00:52:24 -0500
commite7a6d1055574d2dd892f414dbe993ee5782ab488 (patch)
treea78fd289eef1743c3251c173a06526bea30e9bd9 /ipalib/cli.py
parentbce3cd945c66e8e8dc49382356348745eefe8c59 (diff)
downloadfreeipa-e7a6d1055574d2dd892f414dbe993ee5782ab488.tar.gz
freeipa-e7a6d1055574d2dd892f414dbe993ee5782ab488.tar.xz
freeipa-e7a6d1055574d2dd892f414dbe993ee5782ab488.zip
Finalize plugin initialization on demand.
This patch changes the way plugins are initialized. Instead of finalizing all the plugins at once, plugins are finalized only after they are accessed (currently applies to Command, Object and Attribute subclasses, only in CLI by default). This change provides significant performance boost, as only the plugins that are actually used are finalized. ticket 1336
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 7fe808755..7d79775ef 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -684,7 +684,7 @@ class help(frontend.Local):
mcl = max((self._topics[topic_name][1], len(mod_name)))
self._topics[topic_name][1] = mcl
- def finalize(self):
+ def _on_finalize(self):
# {topic: ["description", mcl, {"subtopic": ["description", mcl, [commands]]}]}
# {topic: ["description", mcl, [commands]]}
self._topics = {}
@@ -736,7 +736,7 @@ class help(frontend.Local):
len(s) for s in (self._topics.keys() + [c.name for c in self._builtins])
)
- super(help, self).finalize()
+ super(help, self)._on_finalize()
def run(self, key):
name = from_cli(key)