Fix #854
Pavel
From 6c9f25fa6c50034db4967e64590cc9d46bdf8e0b Mon Sep 17 00:00:00 2001
From: Pavel Zuna pz...@redhat.com
Date: Wed, 2 Feb 2011 12:47:34 -0500
Subject: [PATCH] Fix crash in ipa help for NO_CLI plugins.
Fix #854
---
ipalib/cli.py | 16 ++--
1 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 5543301..9735d2e 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -730,19 +730,6 @@ class help(frontend.Local):
for t in topics:
topic = self._topics[t]
print ' %s %s' % (to_cli(t).ljust(self._mtl), topic[0])
-
-if False:
-topic_commands = self._topics[t][2]
-mod_list = [self._get_command_module(c.module) for c in topic_commands]
-mod_list = list(set(mod_list))
-
-for mod in mod_list:
-m = '%s.%s' % (self._PLUGIN_BASE_MODULE, mod)
-if 'topic' in dir(sys.modules[m]):
-doc = sys.modules[m].topic[1]
-else:
-doc = (sys.modules[m].__doc__ or '').strip().split('\n', 1)[0]
-print ' %s %s' % (to_cli(t).ljust(self._mtl), doc)
print ''
print 'Try `ipa --help` for a list of global options.'
@@ -759,6 +746,7 @@ class help(frontend.Local):
mcl = self._topics[topic][1]
commands = self._topics[topic][2]
else:
+commands = []
for t in self._topics:
if type(self._topics[t][2]) is not dict:
continue
@@ -772,8 +760,8 @@ class help(frontend.Local):
doc = (sys.modules[m].__doc__ or '').strip()
print doc
-print ''
if len(commands) 1:
+print ''
print 'Topic commands:'
for c in commands:
print ' %s %s' % (to_cli(c.name).ljust(mcl), c.summary)
--
1.7.1.1
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel