Martin Kosek wrote:
On Tue, 2011-10-18 at 12:13 -0400, Rob Crittenden wrote:
Forgive me for not having this in git format. This patch fixes a couple
of problems in the help system:

1. If all commands in an object are disabled the object is still visible
as a topic, see ipa help aci as an example

2. ipa help will show you that show-mappings help is broken

3. You shouldn't be able to get help on disabled cli.

diff --git a/ipalib/ b/ipalib/
index 06e7b1c..7fe8087 100644
--- a/ipalib/
+++ b/ipalib/
@@ -748,6 +748,8 @@ class help(frontend.Local):
           elif name in self.Command:
               cmd = self.Command[name]
+            if cmd.NO_CLI:
+                raise HelpError(topic=name)
               print unicode(_('Purpose: %s')) % unicode(_(cmd.doc)).strip()
           elif mod_name in sys.modules:
@@ -805,6 +807,9 @@ class help(frontend.Local):
               m = '%s.%s' % (self._PLUGIN_BASE_MODULE, topic)
               doc = (unicode(_(sys.modules[m].__doc__)) or '').strip()

+            if topic not in self.Command and len(commands) == 0:
+                raise HelpError(topic=topic)
               print doc
               if len(commands)>  1:
                   print ''
@@ -814,6 +819,9 @@ class help(frontend.Local):
               print "\n"

   class show_mappings(frontend.Command):
+    """
+    Show mapping of LDAP attributes to command-line option.
+    """
       takes_args = (
               label=_('Command name'),

ACK. Works fine.

Please, just format it properly and add a commit message with ticket ID before pushing :-)


Done, pushed to master and ipa-2-1

Freeipa-devel mailing list

Reply via email to