Commit Graph
147 Commits
Author SHA1 Message Date
Pavel Zuna c7a35f95c5 Fix output for commands that do not return entries.
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
2010-03-26 16:56:47 -04:00
Pavel Zuna 43ab2c483d Add INTERNAL flag to frontend plugins. If set, the plugin won't show in UI. 2010-03-22 10:41:36 -04:00
John Dennis b75d06e189 localize doc strings
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.
2010-03-08 21:10:36 -07:00
John Dennis 789cba4378 fix bug 570392, command help traceback
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.
2010-03-05 10:03:41 -05:00
Jason Gerard DeRose 47f2e618f9 Fix non XML-RPC tests 2010-02-19 18:10:37 -05:00
Rob Crittenden 3fd098bb60 Used named variables in calls to print_attribute() 2010-02-17 12:05:01 -05:00
Rob Crittenden 63b55307e5 Reverse patch to not encode int values, handled at OID level properly now. 2010-02-17 09:13:50 -07:00
Pavel Zuna 03967f62e9 Auto-generate --all and --raw for commands, that return entries. 2010-02-17 10:56:06 -05:00
Rob Crittenden 7ccac40175 Don't base64-encode integers
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).
2010-02-17 04:13:15 -07:00
Rob Crittenden 58746226d4 Use the Output tuple to determine the order of output
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.
2010-02-15 13:10:11 -07:00
Rob Crittenden 8ca97cdf35 Base64-encode binary values on the command-line 2010-02-02 14:02:42 -05:00
Pavel Zuna cfe47a3553 Temporary fix for name collision of textui.print_entry.
Somehow there's two of them... rename old one to print_entry1.
2010-01-20 16:53:28 -05:00
Jason Gerard DeRose b6e4972e7f Take 2: Extensible return values and validation; steps toward a single output_for_cli(); enable more webUI stuff 2009-12-10 08:29:15 -07:00
Pavel Zuna 973f36c496 Fix Bool parameter type. It was impossible to set it to FALSE. 2009-11-30 13:38:23 -05:00
Pavel Zuna 582228714e Print only one line of docstrings in command listings.
Full docstring is shown on `ipa help COMMAND`.
2009-11-30 13:25:19 -05:00
Rob Crittenden 1d1d82fda4 Fix typo in name of exception 2009-11-12 17:34:19 -05:00
Pavel Zuna 566a3cb972 Add 'File' parameter type.
Accepts filenames and loads file contents as parameter value.
2009-11-06 16:05:31 -07:00
Pavel Zuna 04c5b5ae42 Fix bug in print_attribute.
When the attribute had no values an exception was generated while
trying to word-wrap it.
2009-10-23 09:37:23 -04:00
Jason Gerard DeRose 5c9437b9e6 Removed util.add_global_options() and frontend.Application 2009-10-14 15:07:17 -06:00
Jason Gerard DeRose f58ff2921d Giant webui patch take 2 2009-10-13 11:28:00 -06:00
Pavel Zuna e01b1b8f99 Fix unit tests for plugins using baseldap classes. 2009-10-05 15:59:09 -04:00
Pavel Zuna 34970fef5e Improve attribute printing in the CLI.
- allow choice between single/multiple value per line
- word wrapping
2009-09-08 13:41:54 -04:00
Jason Gerard DeRose c0f558d98b Removed PluginProxy and all its uses 2009-08-05 12:18:51 -04:00
Jason Gerard DeRose 22493eef21 Fix three broken unit tests 2009-08-04 00:21:26 -06:00
Pavel Zuna 104d02e167 Enable attribute re-mapping and ordering when printing entries.
Also print multiple values on one line separated by commas.
2009-08-03 22:56:06 -06:00
Rob Crittenden c0b6a78040 Require a password only once when it is passed in via a pipe 2009-07-10 16:47:35 -04:00
Rob Crittenden d6e1e15fcd Add a one-character option for parameters 2009-07-10 16:46:34 -04:00
Rob Crittenden fe84ffd0f1 Add a return value to exceptions.
Returning the exception value doesn't work because a shell return value
is in the range of 0-255.

The default return value is 1 which means "something went wrong." The only
specific return value implemented so far is 2 which is "not found".
2009-07-10 16:44:54 -04:00
Rob Crittenden 0e29dd7226 Add textui function to display and prompt user for selection for *-find.
Since we may end up executing a *-show when an entry is selected we need
to defer destroying the connection context.
2009-07-10 16:44:22 -04:00
Rob Crittenden e46fd3401e Two new arguments for the help built-in command: topics and commands
ipa help topics will show all topics (equivalent to ipa help)
ipa help commands will show list of all available commands
2009-06-15 14:03:12 -04:00
Rob Crittenden fe012f4ff2 Fix a few issues introduced by the new Param.use_in_context() patch 2009-05-21 14:33:23 -04:00
Jason Gerard DeRose 87480b7bde Re-enable doctest, fix broken docstrings 2009-05-13 14:22:09 -04:00
Rob Crittenden a7a16272b1 When reading a password, if there is no tty, read from stdin instead.
This will allow one to pipe a password in:

echo -e "secret123\secret123\n" | ipa password someuser
2009-05-04 17:43:14 -04:00
Pavel Zuna 9992b23a08 Change help interface to display builtin commands and a list of topics based on plugin modules. 2009-04-30 15:55:16 -04:00
Jason Gerard DeRose 3f4a0a2d77 Fixed cli.run() catching SystemExit exception under Python2.4
Resolves BZ #498088
2009-04-28 22:29:10 -04:00
Pavel Zuna 7d0bd4b895 Rename errors2.py to errors.py. Modify all affected files. 2009-04-23 10:29:14 -04:00
Pavel Zuna 596d410471 Make LDAP entry output slightly nicer, don't print u's in front of unicode strings etc. 2009-04-23 10:25:51 -04:00
Rob Crittenden 64fa3dd4c3 Finish work replacing the errors module with errors2
Once this is committed we can start the process of renaming errors2 as errors.
I thought that combinig this into one commit would be more difficult to
review.
2009-04-20 13:58:26 -04:00
Rob Crittenden 484eff1016 Implement an installer for the Dogtag certificate system.
The CA is currently not automatically installed. You have to pass in the
--ca flag to install it.

What works:
- installation
- unistallation
- cert/ra plugins can issue and retrieve server certs

What doesn't work:
- self-signed CA is still created and issues Apache and DS certs
- dogtag and python-nss not in rpm requires
- requires that CS be in the "pre" install state from pkicreate
2009-04-03 14:06:09 -04:00
Rob Crittenden 65e6259075 Always print the dn first when printing an entry 2009-03-25 11:02:42 -04:00
Jason Gerard DeRose 1359618e7e Fixed broken autfill logic in cli.prompt_interactively() 2009-02-27 12:58:32 -05:00
Rob Crittenden 5a6d2dd0d9 Print out multi-valued values one per-line instead of comman-delimited 2009-02-19 10:08:52 -05:00
Jason Gerard DeRose a0aebd46a1 Got new ldap connection working using Connectible.connect() 2009-02-03 15:29:04 -05:00
Jason Gerard DeRose 231f0bd65a Finished reworked cli.CLI class into cli.cli plugin 2009-02-03 15:29:04 -05:00
Jason Gerard DeRose db0168f7af Started reworking CLI class into cli plugin 2009-02-03 15:29:03 -05:00
Jason Gerard DeRose 7a0f969a47 CLI now logs trace if it catches a non-public error and then exists with an InternalError; other CLI cleanup 2009-02-03 15:29:02 -05:00
Jason Gerard DeRose c0bc2451dd Fixed another small CLI decoding problem (multivalue args in a tuple now work) 2009-02-03 15:29:02 -05:00
Jason Gerard DeRose e537dc89cb Fixed a few problems in the CLI interactive prompting (wont prompt for Flag now) 2009-02-03 15:29:02 -05:00
Jason Gerard DeRose 244346dbcb More work on xmlrpc stuff, started migrated more code to use errors2 instead of errors 2009-02-03 15:29:01 -05:00
Jason Gerard DeRose 833088955c More xmlrpc tweaks: xmlserver.execute() now logs non-public exceptions; xmlclient.forward() now handles socket error; fixed some Python 2.4 problems in lite-xmlrpc2.py 2009-02-03 15:29:01 -05:00