Commit Graph

78 Commits

Author SHA1 Message Date
Martin Kosek
092dd8db12 Replace float with Decimal
Having float type as a base type for floating point parameters in
ipalib introduces several issues, e.g. problem with representation
or value comparison. Python language provides a Decimal type which
help overcome these issues.

This patch replaces a float type and Float parameter with a
decimal.Decimal type in Decimal parameter. A precision attribute
was added to Decimal parameter that can be used to limit a number
of decimal places in parameter representation. This approach fixes
a problem with API.txt validation where comparison of float values
may fail on different architectures due to float representation error.

In order to safely transfer the parameter value over RPC it is
being converted to string which is then converted back to
decimal.Decimal number on a server side.

https://fedorahosted.org/freeipa/ticket/2260
2012-01-20 08:13:44 +01:00
Jan Cholasta
135ccf89de Parse comma-separated lists of values in all parameter types. This can be enabled for a specific parameter by setting the "csv" option to True.
Remove "List" parameter type and replace all occurences of it with appropriate
multi-valued parameter ("Str" in most cases) with csv enabled.

Add new parameter type "Any", capable of holding values of any type. This is
needed by the "batch" command, as "Str" is not suitable type for the "methods"
parameter.

ticket 2007
2011-11-30 17:08:35 +01:00
Rob Crittenden
2f4b3972a0 Add plugin framework to LDAP updates.
There are two reasons for the plugin framework:
1. To provide a way of doing manual/complex LDAP changes without having
   to keep extending ldapupdate.py (like we did with managed entries).
2. Allows for better control of restarts.

There are two types of plugins, preop and postop. A preop plugin runs
before any file-based updates are loaded. A postop plugin runs after
all file-based updates are applied.

A preop plugin may update LDAP directly or craft update entries to be
applied with the file-based updates.

Either a preop or postop plugin may attempt to restart the dirsrv instance.
The instance is only restartable if ipa-ldap-updater is being executed
as root. A warning is printed if a restart is requested for a non-root
user.

Plugins are not executed by default. This is so we can use ldapupdate
to apply simple updates in commands like ipa-nis-manage.

https://fedorahosted.org/freeipa/ticket/1789
https://fedorahosted.org/freeipa/ticket/1790
https://fedorahosted.org/freeipa/ticket/2032
2011-11-22 23:57:10 -05:00
Yuri Chornoivan
1785d0a7c1 Fix typos
Fix "The the" and "classses" in FreeIPA code and messages.

https://fedorahosted.org/freeipa/ticket/1480
2011-09-07 13:20:42 +02:00
Pavel Zuna
f3de95ce99 Fix translatable strings in ipalib plugins.
Needed for xgettext/pygettext processing.
2011-03-01 10:31:40 -05:00
Jakub Hrozek
7493d781df Change FreeIPA license to GPLv3+
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
2010-12-20 17:19:53 -05:00
Rob Crittenden
6e2dd0fa5b Add new parameter type IA5Str and use this to enforce the right charset.
ticket 496
2010-12-07 16:37:42 -05:00
Simo Sorce
c51ce61e4d UUIDs: remove uuid python plugin and let DS always autogenerate
merge in remove uuid
2010-10-28 07:58:31 -04:00
Jason Gerard DeRose
c350f84134 Finish deferred translation mechanism 2010-03-16 11:41:22 -06:00
Rob Crittenden
766757e4d4 Fix unicode failures in Env tests and dn failures in XML-RPC tests 2010-02-26 12:31:11 -05: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
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
34deb3fef3 Rename GeneralizedTime to AccessTime. 2009-12-01 10:38:56 -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
Jason Gerard DeRose
5c9437b9e6 Removed util.add_global_options() and frontend.Application 2009-10-14 15:07:17 -06:00
Pavel Zuna
a6eb928f98 Add HBAC plugin and introduce GeneralizedTime parameter type. 2009-10-05 15:55:27 -04:00
Rob Crittenden
df17e42216 Many SELinux fixes: ldapi, ctypes and dogtag
ldapi: grants httpd and krb5kdc to access the DS ldapi socket

ctypes: the Python uuid module includes ctypes which makes httpd segfault
due to SELinux problems.

dogtag: remove the CRL publishing permissions. This only worked if you
had dogtag installed. In the near future will publish elsewhere so for
the time being CRL file publishing will be broken with SELinux enabled.
2009-09-10 11:40:59 -04:00
Jason Gerard DeRose
c0f558d98b Removed PluginProxy and all its uses 2009-08-05 12:18:51 -04:00
Jason Gerard DeRose
7e58b29a92 Completed Param.use_in_context() functionality, which is now used by Command and Object 2009-05-21 14:32:45 -04:00
Jason Gerard DeRose
87480b7bde Re-enable doctest, fix broken docstrings 2009-05-13 14:22:09 -04:00
Jason Gerard DeRose
ae38a2461f Force xmlrpc tests to run with in_tree=True so config files in /etc/ipa/ don't get read; cleaned up config.Env automagic with regard to running in-tree vs. installed 2009-05-11 16:17:08 -04:00
Pavel Zuna
7d0bd4b895 Rename errors2.py to errors.py. Modify all affected files. 2009-04-23 10:29:14 -04:00
Rob Crittenden
a8a2664190 Add new type List that converts delimited values into a tuple 2009-03-20 09:29:44 -04:00
Jason Gerard DeRose
4ab133c3cb Implemented more elegant way for entire plugin module to be conditionally skipped; updated cert.py and ra.py modules to use this 2009-02-17 16:03:10 -05:00
Jason Gerard DeRose
e0fe732318 Added env.enable_ra variable and change cert.py and ra.py plugin modules to register plugins conditionally 2009-02-17 16:03:09 -05:00
Jason Gerard DeRose
91ca06f079 Added doodle for version vars in ipalib.__init__ 2009-02-03 15:29:05 -05:00
Jason Gerard DeRose
48a278047d Mostly got the test_xmlrpc/ tests working again 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
0cfb0e191a Removed the depreciated Context and LazyContext classes 2009-02-03 15:29:03 -05:00
Jason Gerard DeRose
12c4879613 Added ca_host, ca_port, and ca_ssl_port Env variables that Andrew requested 2009-02-03 15:29:00 -05:00
Jason Gerard DeRose
6aadeb9aea Added Object.params_minus() method; various small tweaks 2009-02-03 15:29:00 -05:00
Jason Gerard DeRose
4febb4dd14 Started roughing out new crud base classes 2009-02-03 15:28:59 -05:00
Rob Crittenden
e708765d61 Include local copy of UUID generator for Python 2.4.
Python 2.5+ has a built-in RFC 4122-compliant UUID generator. Include a
copy of this file in our library and import it in a way that it will
work with Python 2.4.
2009-01-19 10:40:11 -05:00
Jason Gerard DeRose
364e05def1 Added missing enumerable parameters 2009-01-18 15:55:56 -07:00
Jason Gerard DeRose
ec86208a90 Updated passwd plugins module to where it can at least be imported 2009-01-14 22:19:31 -07:00
Jason Gerard DeRose
0327b83899 New Param: all docstring examples now pass under doctests 2009-01-14 20:36:17 -07:00
Jason Gerard DeRose
f3e0900ebc New Param: ipalib.__init__ no longer import ipa_types and instead imports appropriate classes from parameters 2009-01-14 11:32:32 -07:00
Jason Gerard DeRose
6fe78a4944 Renamed all references to 'ipa_server' to 'ipaserver' 2009-01-04 18:39:39 -07:00
Jason Gerard DeRose
fd43b39145 Moved setting of run-time variables from Env.__init__() to Env._bootstrap() 2008-12-22 23:09:35 -07:00
Jason Gerard DeRose
36737c2d91 Added frontend.LocalOrRemote command base class for commands like env 2008-11-14 21:29:46 -07:00
Jason Gerard DeRose
3433840692 Fixed doctest in tutorial 2008-11-14 19:48:01 -07:00
Jason Gerard DeRose
f8f4058014 Tutorial: fixed typo in 'How your command should print to stdout' section 2008-11-14 14:53:55 -07:00
Jason Gerard DeRose
caa98476f0 Tutorial: fixed typo in 'First steps: A simple command plugin' section 2008-11-14 14:49:48 -07:00
Jason Gerard DeRose
1abe3abb87 Tutorial: another small change to section on using output_for_cli() 2008-11-14 14:35:52 -07:00
Jason Gerard DeRose
0f1ed3e904 Tutorial: command in output_for_cli() example now also takes an argument 2008-11-14 14:27:09 -07:00
Jason Gerard DeRose
6d1ec6360c Tutorial: small improvements to section on using output_for_cli() 2008-11-14 12:43:10 -07:00
Jason Gerard DeRose
0313bb7ec0 Tutorial: added section on implementing an output_for_cli() method 2008-11-14 12:19:18 -07:00
Jason Gerard DeRose
44171a0bad Tutorial: added section on allowed return values from a command's execute() method 2008-11-14 01:25:05 -07:00
Jason Gerard DeRose
860d391f3e Change Param.__repr__() so it returns the exact expression that could create it; added unit test for Param.__repre__() 2008-11-13 22:16:04 -07:00
Jason Gerard DeRose
f3869d7b24 Renamed ipalib.get_standard_api() to create_api() 2008-11-11 15:24:18 -07:00