summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2011-02-02 12:47:34 -0500
committerRob Crittenden <rcritten@redhat.com>2011-02-02 10:47:53 -0500
commitdba751758c21ab4223dd106cd21c7f6f34743e8c (patch)
treee6894273f607038b1d5e11f3ce203b2039b7d8ea /ipalib/cli.py
parent275998f6bde90c253d935c2f2724538b64cbd618 (diff)
downloadfreeipa-dba751758c21ab4223dd106cd21c7f6f34743e8c.tar.gz
freeipa-dba751758c21ab4223dd106cd21c7f6f34743e8c.tar.xz
freeipa-dba751758c21ab4223dd106cd21c7f6f34743e8c.zip
Fix crash in ipa help for NO_CLI plugins.
Fix #854
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 5ef812f75..4ce7e7fa9 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)