Commit Graph

182 Commits

Author SHA1 Message Date
Rob Crittenden
2da6d6e746 Don't set delegation flag in client, we're using S4U2Proxy now
A forwardable ticket is still required but we no longer need to send
the TGT to the IPA server. A new flag, --delegate, is available if
the old behavior is required.

Set the minimum n-v-r for mod_auth_kerb and krb5-server to pick up
needed patches for S4U2Proxy to work.

https://fedorahosted.org/freeipa/ticket/1098
https://fedorahosted.org/freeipa/ticket/2246
2012-02-15 17:08:33 +01:00
John Dennis
167813f343 Restore default log level in server to INFO
The default log level for server messages captured by httpd's
error_log historically was INFO. The log_manager patch had it set to
ERROR, this patch resets it back to INFO.

Although it would have been trival to set the default_level to INFO in
IPALogManager.configure_from_env() that is not logically the correct
place. It would be much better if the default_level can be reset by
simply assigning it to the log_mgr. To accomplish that
LogManager.default_level was converted to a property with a getter and
setter. The setter runs LogManager.apply_configuratin() after the
default_level is modified. LogManager.set_default_level() was also
added to allow simultaneously updating the configure_state.

While testing some minor problems were observed and also fixed:

* Removed some print statement which had been left in by mistake

* Removed the ability to set the handler level in the config file
  because of chicken-and-egg issues of when handlers get created.
  The Env config file format is too inflexible to support detailed
  logging configuration. If the Env config format is ever made more
  flexible we can come back and add this back in. The handler config
  setting in Env had never been used and never worked so there is no
  issue in removing it.
2011-12-01 08:34:02 +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
John Dennis
56401c1abe ticket 2022 - modify codebase to utilize IPALogManager, obsoletes logging
change default_logger_level to debug in configure_standard_logging

add new ipa_log_manager module, move log_mgr there, also export
root_logger from log_mgr.

change all log_manager imports to ipa_log_manager and change
log_manager.root_logger to root_logger.

add missing import for parse_log_level()
2011-11-23 09:36:18 +01:00
Jan Cholasta
e7a6d10555 Finalize plugin initialization on demand.
This patch changes the way plugins are initialized. Instead of
finalizing all the plugins at once, plugins are finalized only after
they are accessed (currently applies to Command, Object and
Attribute subclasses, only in CLI by default).

This change provides significant performance boost, as only the
plugins that are actually used are finalized.

ticket 1336
2011-11-22 00:52:24 -05:00
Alexander Bokovoy
50a836b44c Cleanup whitespace 2011-09-13 11:16:10 +02:00
Rob Crittenden
b02b77f8d7 Slight performance improvement by not doing some checking in production mode
These changes save a few hundred ms but every little bit helps.

ticket 1023
2011-06-23 23:45:10 -04:00
Pavel Zuna
1eb3033311 Final i18n unit test fixes. 2011-03-01 10:31:43 -05:00
Pavel Zuna
fc842e3650 Use pygettext to generate translatable strings from plugin files.
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.
2011-03-01 10:31:42 -05:00
Pavel Zuna
f3de95ce99 Fix translatable strings in ipalib plugins.
Needed for xgettext/pygettext processing.
2011-03-01 10:31:40 -05:00
Pavel Zuna
8145952752 Translate docstrings. 2011-03-01 10:31:39 -05:00
Rob Crittenden
29706fb13b Add default success/failure output logging.
Request logging on the server only happened if you added verbose=True
or debug=True to the IPA config file. We should log the basics at
least: who, what, result.

Move a lot of entries from info to debug logging as well.

Related to ticket 873
2011-02-14 10:23:52 -05:00
Rob Crittenden
c187b276ad Fix test failures caused by the performance patch.
It isn't safe to assume there is an environment or mode in any given
object. Only skip the extra work if the object explicitly has production
in it.
2011-02-10 13:52:29 -05:00
Rob Crittenden
359d54e741 Don't perform some API self-tests in production mode for performance reasons
The API does a fair number of self tests and locking to assure that the
registered commands are consistent and will work. This does not need
to be done on a production system and adds additional overhead causing
somewhere between a 30 and 50% decrease in performance.

Because makeapi is executed when a build is done ensure that it is
executed in developer mode to ensure that the framework is ok.

ticket 751
2011-01-28 18:49:17 -05:00
Rob Crittenden
84ff4ca0f1 Don't require or create the log dirs if we're just validating the API.
Fixes an error displayed in the automated builds, plus we don't want
a Makefile messing around with our homedir.
2011-01-14 17:26:49 -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
1df10a88cd Add support for client failover to the ipa command-line.
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
2010-08-16 10:35:27 -04:00
Rob Crittenden
ccaf537aa6 Handle errors raised by plugins more gracefully in mod_wsgi.
This started as an effort to display a more useful error message in the
Apache error log if retrieving the schema failed. I broadened the scope
a little to include limiting the output in the Apache error log
so errors are easier to find.

This adds a new configuration option, startup_traceback. Outside of
lite-server.py it is False by default so does not display the traceback
that lead to the StandardError being raised. This makes the mod_wsgi
error much easier to follow.
2010-07-12 09:32:33 -04:00
Rob Crittenden
1dd7b11b0b Connect the -v cli argument to the verbose flag in xmlrpclib
If you pass two -v to the ipa command you'll get the XML-RPC data in
the output. This can be handy so you know exactly what went out over
the wire.
2010-06-03 17:08:22 -04:00
Jason Gerard DeRose
069763c5c6 Add Object.label class attribute, enable in webUI 2010-02-12 17:07:37 -05:00
Jason Gerard DeRose
0ce253fae4 Fix logging in CLI and server (take 2) 2010-02-09 16:36:27 -05:00
Rob Crittenden
f43f6c50c6 Only change the log level if it isn't already set
This primarily affects the installer. We want to log to the install/
uninstall file in DEBUG. This was getting reset to INFO causing lots of
details to not show in the logs.
2010-02-03 11:52:15 -05:00
Jason Gerard DeRose
1d6cc1bb7b Remove __public__ and __proxy__ hold-overs from Plugin class 2010-01-28 13:32:00 -05:00
Jason Gerard DeRose
7b571e3693 Enabled CRUDS in webUI using wehjit 0.2.0 2010-01-26 10:32:44 -05:00
John Dennis
dbb5721e7c If plugin fails to load log the traceback
Signed-off-by: John Dennis <jdennis@redhat.com>

If plugin fails to load log the traceback

If a plugin fails to load due to some kind of error it would be nice
if the error log contained the traceback so you can examine what went
wrong rather than being left blind as to why it failed to load.
2009-11-23 16:30:01 -05:00
Rob Crittenden
50b683dc3c Provide additional help to --help option 2009-11-19 14:38:01 -05:00
Jason Gerard DeRose
8dc21d6f30 Make plugin browser show plugin parent class 2009-10-14 15:08:30 -06:00
Jason Gerard DeRose
f58ff2921d Giant webui patch take 2 2009-10-13 11:28:00 -06:00
Jason Gerard DeRose
c0f558d98b Removed PluginProxy and all its uses 2009-08-05 12:18:51 -04:00
Pavel Zuna
c47d716e95 Modify PluginProxy to use __public__ defined in derived classes instead of base classes. 2009-06-10 11:53:07 -04:00
Pavel Zuna
7d0bd4b895 Rename errors2.py to errors.py. Modify all affected files. 2009-04-23 10:29:14 -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
a8c3f054d4 Started cleanup work on ra plugin; fixed problem in api.bootstrap() when process does not have permision to open log file 2009-02-17 16:03:08 -05:00
Jason Gerard DeRose
c2b0c80140 Started work on a much simplified mod_python server 2009-02-03 15:29:05 -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
0cfb0e191a Removed the depreciated Context and LazyContext classes 2009-02-03 15:29:03 -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
6fe78a4944 Renamed all references to 'ipa_server' to 'ipaserver' 2009-01-04 18:39:39 -07:00
Jason Gerard DeRose
912ab9e68b Removed unneeded import of errors from plugable.py 2009-01-03 18:08:39 -07:00
Jason Gerard DeRose
bb6e9cfe9f Plugin.call() now uses errors2 version of SubprocessError 2009-01-03 18:02:58 -07:00
Jason Gerard DeRose
6b6e6b1cab Ported plugin registration errors into errors2.py; plugable.Registrar now raises new errors2 exceptions 2009-01-03 17:27:53 -07:00
Jason Gerard DeRose
72340a594d Removed unneeded import of check_type, check_instance in plugable.py 2009-01-02 01:16:17 -07:00
Jason Gerard DeRose
b4dc333ee2 Removed depreciated code in ipalib.plugable that has been moving into ipalib.base 2009-01-02 00:46:45 -07:00
Jason Gerard DeRose
5b637f6a18 Removed depreciated code from config.py; removed corresponding unit tests 2008-12-22 15:41:24 -07:00
Jason Gerard DeRose
f82c48f775 Added note in Plugin.set_api() about Plugin.log attribute being depreciated 2008-12-21 19:58:48 -07:00
Jason Gerard DeRose
9d091c98f1 Plugin.__init__() now checks that subclass hasn't defined attributes that conflict with the logger methods; added corresponding unit test 2008-12-21 19:34:32 -07:00
Jason Gerard DeRose
4390523b7f Improved Plugin.call() method and added its unit test 2008-12-21 17:12:00 -07:00
Jason Gerard DeRose
4f24f0fd88 Plugin.doc instance attribute is now parsed out using inspect.getdoc(); added Plugin.summary instance attribute, created in Plugin.__init__() 2008-12-17 23:08:52 -07:00
Jason Gerard DeRose
171ed58367 Removed Plugin.doc property and replaced with instance attribute created in Plugin.__init__() 2008-12-17 21:57:58 -07:00