summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
Commit message (Collapse)AuthorAgeFilesLines
* ticket 1706 - internationalize cli help frameworkJohn Dennis2011-08-241-7/+7
| | | | | | | | | In cli.py is a framework for printing out help information. The command documentation being displayed is internationalized, however the text generated by the help framework itself is not internationalized. The strings output by the help subsystem need to be internationalized.
* ticket 1705 - internationalize help topicsJohn Dennis2011-08-241-5/+3
| | | | | | | | | | | | * Wrap each topic description in _() * Replace the use of if 'topic' in dir(module) with the more Pythonic and efficient getattr(module, 'topic', None) * Make sure to invoke unicode on the value returned from _() otherwise you'll get a GettextFactory instance, not a string * Clean up trailing whitespace errors
* Add option to only prompt once for passwords, use in entitle_registerRob Crittenden2011-08-241-4/+6
| | | | | | | | | A Password param always prompted to confirm the entered password. This doesn't make sense if you want to prompt for a password to another system like we do with entitlements. This adds a new boolean option to control the Password prompt parameter. https://fedorahosted.org/freeipa/ticket/1695
* Improve interactive mode for DNS pluginMartin Kosek2011-06-021-0/+44
| | | | | | | | | | | | Interactive mode for commands manipulating with DNS records (dnsrecord-add, dnsrecord-del) is not usable. This patch enhances the server framework with new callback for interactive mode, which can be used by commands to inject their own interactive handling. The callback is then used to improve aforementioned commands' interactive mode. https://fedorahosted.org/freeipa/ticket/1018
* Assume ipa help for plugins.Jan Cholasta2011-05-131-0/+6
| | | | ticket 914
* Several improvements of the lint script.Jan Cholasta2011-05-051-0/+1
| | | | | | | | Report missing python packages, inform about false positives, fail gracefully if pylint isn't installed. Fixed a bug in the ignore list and added few more files/directories to it. ticket 1184
* Fix lint false positives.Jan Cholasta2011-04-131-2/+2
|
* Use pygettext to generate translatable strings from plugin files.Pavel Zuna2011-03-011-1/+1
| | | | | | | | | | | | This patch replaces xgettext with a custom pygettext to generate translatable strings from plugin files in ipalib/plugins. pygettext was modified to handle plural forms (credit goes to Jan Hendrik Goellner) and had some bugs fixed by myself. We only use it for plugins, because it's the only place where we need to extract docstrings for the built-in help system. I also had to make some changes to the way the built-in documentation systems gets docstrings from modules for this to work.
* Translate docstrings.Pavel Zuna2011-03-011-3/+7
|
* Fixed type of argument in class helpJan Zeleny2011-02-141-1/+1
|
* Provide a way to display CLI-LDAP relationJan Zeleny2011-02-101-1/+26
| | | | | | | | | | | Since some LDAP attributes have their cli_name value defined, so they can be more user friendly, it can be difficult for user to find out which attributes do the parameteres given to CLI really represent. This patch provides new command, which will take another IPA command as and argument and display attributes which given command takes and what LDAP attributes are they mapped to. https://fedorahosted.org/freeipa/ticket/447
* Fix crash in ipa help for NO_CLI plugins.Pavel Zuna2011-02-021-14/+2
| | | | Fix #854
* Add support for tracking and counting entitlementsRob Crittenden2011-02-021-2/+12
| | | | | | | | | | | | | | Adds a plugin, entitle, to register to the entitlement server, consume entitlements and to count and track them. It is also possible to import an entitlement certificate (if for example the remote entitlement server is unaviailable). This uses the candlepin server from https://fedorahosted.org/candlepin/wiki for entitlements. Add a cron job to validate the entitlement status and syslog the results. tickets 28, 79, 278
* Add brackets around optional parameters when prompting.Rob Crittenden2011-01-251-4/+8
| | | | ticket 832
* Fix assorted bugs found by pylintJakub Hrozek2011-01-251-11/+0
|
* Fix crash when displaying values composed of white-space chars only in CLI.Pavel Zuna2011-01-241-0/+2
| | | | Ticket #825
* Rename INTERNAL to NO_CLI for commands we hide from the cli.Rob Crittenden2011-01-211-3/+3
| | | | | | Also make i18n_messages and json_metadata NO_CLI. ticket 821
* Make command syntax less confusing in helpJan Zeleny2011-01-211-0/+1
| | | | | | The patch adds [options] to the syntax line of ipa help <command> https://fedorahosted.org/freeipa/ticket/733
* Add API version and have server reject incompatible clients.Rob Crittenden2011-01-141-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | This patch contains 2 parts. The first part is a small utility to create and validate the current API. To do this it needs to load ipalib which on a fresh system introduces a few problems, namely that it relies on a python plugin to set the default encoding to utf8. For our purposes we can skip that. It is also important that any optional plugins be loadable so the API can be examined. The second part is a version exchange between the client and server. The version has a major and a minor version. The major verion is updated whenever existing API changes. The minor version is updated when new API is added. A request will be rejected if either the major versions don't match or if the client major version is higher than then server major version (though by implication new API would return a command not found if allowed to proceed). To determine the API version of the server from a client use the ping command. ticket 584
* Fix output of failed managedby hosts, allow a host to manage itself.Rob Crittenden2011-01-111-2/+2
| | | | | | | | | | | The output problem was a missing label for failed managedby. This also fixes a call to print_entry that was missing the flags argument. Add a flag to specify whether a group can be a member of itself, defaulting to False. ticket 708
* Display the entries that failed when deleting with --continue.Rob Crittenden2011-01-101-3/+6
| | | | | | | | | | | | We collected the failures but didn't report it back. This changes the API of most delete commands so rather than returning a boolean it returns a dict with the only current key as failed. This also adds a new parameter flag, suppress_empty. This will try to not print values that are empty if included. This makes the output of the delete commands a bit prettier. ticket 687
* Changed concept of ipa helpJan Zeleny2011-01-071-20/+97
| | | | | | | | | | | | | | | | | | | | | | | | The concept is now following: topic: either a module or a group of modules containing registered commands. All these commands will usually handle common entity type (e.g. hbac rules) subtopic: each topic can have a number of subtopics. In this case topic is a group of modules and each module represents a subtopic. grouping modules to topics is possible by assigning a 2-tuple to module variable: topic = ('topic-name','topic description') The topic description has to be the same in all modules in the topic. These are examples of commands now available in IPA help: ipa help - display a list of all topics ipa help hbac - display help for hbac topic ipa help hbacrule - display help for a subtopic of hbac ipa help hbacrule-add - display help for a particular command https://fedorahosted.org/freeipa/ticket/410
* Change FreeIPA license to GPLv3+Jakub Hrozek2010-12-201-5/+5
| | | | | | | | | | The changes include: * Change license blobs in source files to mention GPLv3+ not GPLv2 only * Add GPLv3+ license text * Package COPYING not LICENSE as the license blobs (even the old ones) mention COPYING specifically, it is also more common, I think https://fedorahosted.org/freeipa/ticket/239
* If any params marked alwaysask are provided then prompt for none of them.Rob Crittenden2010-12-091-1/+6
| | | | ticket 604
* Add labels for passwords, fix output of exceptions, fix passwd output.Rob Crittenden2010-12-021-1/+1
| | | | | | | | | | | Passwords didn't have internationalizable labels. Exceptions that occured during required input weren't printed as unicode so weren't being translated properly. Don't use output_for_cli() directly in the passwd plugin, use output.Output. ticket 352
* Use better description for group names in help and always prompt for membersRob Crittenden2010-12-021-5/+8
| | | | | | | | | | | | | | | | | | | When running <foo>-[add|remove]-member completely interactively it didn't prompt for managing membership, it just reported that 0 members were handled which was rather confusing. This will work via a shell if you want to echo too: $ echo "" | ipa group-add-member g1 This returns 0 members because nothing is read for users or group members. $ echo -e "g1\nadmin\n" | ipa group-add-member This adds the user admin to the group g1. It adds it as a user because user membership is prompted for first. ticket 415
* Prompt correctly for required Password params.Pavel Zuna2010-11-301-10/+13
| | | | Ticket #361
* Don't include INTERNAL commands in `ipa help commands` output.Rob Crittenden2010-11-101-0/+2
| | | | ticket 463
* Return reason for failure when updating group membership fails.Rob Crittenden2010-10-281-1/+13
| | | | | | | | | | | We used to return a list of dns that failed to be added. We now return a list of tuples instead. The tuple looks like (dn, reason) where reason is the exception that was returned. Also made the label we use for failures to be singular instead of plural since we now print them out individually instead of as comma-separated. ticket 270
* Set default encoding to utf-8, use unicode when printing output.Rob Crittenden2010-10-221-4/+5
| | | | | | The Gettext() object only does the lookup when you print it as a unicode. ticket 308
* Add Requires on ipa-client to ipa-admintools, ensure ipa client is configuredRob Crittenden2010-10-151-1/+3
| | | | | | | | | | It makes little sense to install ipa-admintools without ipa-client, require it. Also see if the client has been configured. This is a bit tricky since we have a full set of defaults. Add a new env option that gets set if at least one configuration file is loaded. ticket 213
* Try to make topic help less confusing. Rename Related to Topic commands.Rob Crittenden2010-09-231-3/+4
| | | | | | | Also don't print the commands at the bottom if the plugin implements only one command, like the passwd plugin. ticket 105
* Add support for client failover to the ipa command-line.Rob Crittenden2010-08-161-2/+3
| | | | | | | | | | | | This adds a new global option to the ipa command, -f/--no-fallback. If this is included then just the server configured in /etc/ipa/default.conf is used. Otherwise that is tried first then all servers in DNS with the ldap SRV record are tried. Create a new Local() Command class for local-only commands. The help command is one of these. It shouldn't need a remote connection to execute. ticket #15
* Fix output for commands that do not return entries.Pavel Zuna2010-03-261-2/+2
| | | | | | | | | | | | I also changed the default value of the print_all argument in textui.print_entry from False to True. It think it makes more sense this way, because: 1) if order is None, it will still print something 2) if order is not None, it will print what's in order first and then the rest 3) commands that care about the print_all argument have to set it in any case, those that don't care usually want to print everything
* Add INTERNAL flag to frontend plugins. If set, the plugin won't show in UI.Pavel Zuna2010-03-221-1/+3
|
* localize doc stringsJohn Dennis2010-03-081-1/+1
| | | | | | | | | | | | A number of doc strings were not localized, wrap them in _(). Some messages were not localized, wrap them in _() Fix a couple of failing tests: The method name in RPC should not be unicode. The doc attribute must use the .msg attribute for comparison. Also clean up imports of _() The import should come from ipalib or ipalib.text, not ugettext from request.
* fix bug 570392, command help tracebackJohn Dennis2010-03-051-1/+1
| | | | | | | | | | | | | | | | | | | As a consequence of using doc=_('some message') the _() method was returning a Gettext instance, thus when optparse was handed the help text it received a Gettext instance instead of a basestring. optparse tried to operate on the Gettext instance as if it were a basestring and since it wasn't threw an exception. The fix is to promote (e.g. cast) the option.doc to unicode. If the option.doc was a str it becomes unicode, if it was unicode nothing happens, if it was Gettext (or any other object implementing the __unicode__() method) object is converted to unicode via the objects rules. By the way, while debugging this I discovered strings which were not localized, sometimes option.doc would be a str and sometimes a Gettext object. In a subsequent patch I'll fix all those unlocalized doc strings, but I don't want to bury this fix along with a load of string fixes.
* Fix non XML-RPC testsJason Gerard DeRose2010-02-191-9/+0
|
* Used named variables in calls to print_attribute()Rob Crittenden2010-02-171-2/+2
|
* Reverse patch to not encode int values, handled at OID level properly now.Rob Crittenden2010-02-171-5/+1
|
* Auto-generate --all and --raw for commands, that return entries.Pavel Zuna2010-02-171-26/+34
|
* Don't base64-encode integersRob Crittenden2010-02-171-1/+5
| | | | | | This is a temporary fix until we either use Params to determine output type or treat integers differently from other binary values internally (as unicode instead of str, for example).
* Use the Output tuple to determine the order of outputRob Crittenden2010-02-151-5/+8
| | | | | | | | | | | | | | The attributes displayed is now dependant upon their definition in a Param. This enhances that, giving some level of control over how the result is displayed to the user. This also fixes displaying group membership, including failures of adding/removing entries. All tests pass now though there is still one problem. We need to return the dn as well. Once that is fixed we just need to comment out all the dn entries in the tests and they should once again pass.
* Base64-encode binary values on the command-lineRob Crittenden2010-02-021-3/+17
|
* Temporary fix for name collision of textui.print_entry.Pavel Zuna2010-01-201-1/+1
| | | | Somehow there's two of them... rename old one to print_entry1.
* Take 2: Extensible return values and validation; steps toward a single ↵Jason Gerard DeRose2009-12-101-3/+55
| | | | output_for_cli(); enable more webUI stuff
* Fix Bool parameter type. It was impossible to set it to FALSE.Pavel Zuna2009-11-301-1/+1
|
* Print only one line of docstrings in command listings.Pavel Zuna2009-11-301-4/+3
| | | | Full docstring is shown on `ipa help COMMAND`.
* Fix typo in name of exceptionRob Crittenden2009-11-121-1/+1
|
* Add 'File' parameter type.Pavel Zuna2009-11-061-1/+34
| | | | Accepts filenames and loads file contents as parameter value.