summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-11-16 19:50:17 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-11-16 19:50:17 -0700
commite7ec4131589d5d387c4257bca76e91a17ad7e1a3 (patch)
tree74117c4b2836a2dde54f01b4a2c66e46c4d75c9f
parente059591d6b190cbc6c50d0b96e1f63fddb30a934 (diff)
downloadfreeipa.git-e7ec4131589d5d387c4257bca76e91a17ad7e1a3.tar.gz
freeipa.git-e7ec4131589d5d387c4257bca76e91a17ad7e1a3.tar.xz
freeipa.git-e7ec4131589d5d387c4257bca76e91a17ad7e1a3.zip
Moved plugins command from ipalib.cli to ipalib.plugins.f_misc
-rw-r--r--ipalib/cli.py19
-rw-r--r--ipalib/plugins/f_misc.py20
2 files changed, 20 insertions, 19 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index dd20b365..fc58f2e9 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -381,29 +381,10 @@ class show_api(frontend.Application):
self.__traverse_namespace(n, attr, lines, tab + 2)
-class plugins(frontend.Application):
- """Show all loaded plugins"""
-
- def run(self):
- plugins = sorted(self.api.plugins, key=lambda o: o.plugin)
- return tuple(
- (p.plugin, p.bases) for p in plugins
- )
-
- def output_for_cli(self, textui, result, **kw):
- textui.print_name(self.name)
- for (plugin, bases) in result:
- textui.print_indented(
- '%s: %s' % (plugin, ', '.join(bases))
- )
- textui.print_count(result, '%d plugin loaded', '%s plugins loaded')
-
-
cli_application_commands = (
help,
console,
show_api,
- plugins,
)
diff --git a/ipalib/plugins/f_misc.py b/ipalib/plugins/f_misc.py
index b2f97c71..a2f0fa4e 100644
--- a/ipalib/plugins/f_misc.py
+++ b/ipalib/plugins/f_misc.py
@@ -67,3 +67,23 @@ class env(LocalOrRemote):
textui.print_count(result, '%d variables')
api.register(env)
+
+
+class plugins(LocalOrRemote):
+ """Show all loaded plugins"""
+
+ def execute(self, **options):
+ plugins = sorted(self.api.plugins, key=lambda o: o.plugin)
+ return tuple(
+ (p.plugin, p.bases) for p in plugins
+ )
+
+ def output_for_cli(self, textui, result, **options):
+ textui.print_name(self.name)
+ for (plugin, bases) in result:
+ textui.print_indented(
+ '%s: %s' % (plugin, ', '.join(bases))
+ )
+ textui.print_count(result, '%d plugin loaded', '%s plugins loaded')
+
+api.register(plugins)