summaryrefslogtreecommitdiffstats
path: root/ipalib/plugable.py
Commit message (Collapse)AuthorAgeFilesLines
* Add version and API versionGabe2014-06-091-0/+3
| | | | | | | | | | - Add API version to constants.py - Add version option to plugable.py - Add version to ipa manpage and fix a couple of typos https://fedorahosted.org/freeipa/ticket/4316 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
* ipalib.plugable: Always set the parser in bootstrap()Petr Viktorin2014-03-051-4/+6
| | | | | | | | | | In cases where logging was already configured by the time API.bootstrap() was called, saving the argument parser was mistakenly skipped along with the logging configuration. Always set the argument parser on the API object. Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* Allow API plugin registration via a decoratorPetr Viktorin2013-08-141-0/+27
| | | | | | | | | | | | This makes plugin registration easier to read, less error-prone, and, for many Plugins in a single module, faster to write. Functionally, the decorator is equivalent to current plugin registration. However, in the future this style will allow cleaner semantics. As an example, and to exercise the new syntax to prevent regressions, the ping plugin is converted to this style.
* Provide ipa-advise toolTomas Babej2013-07-171-0/+2
| | | | | | | | | | | | | | Provides a pluggable framework for generating configuration scriptlets and instructions for various machine setups and use cases. Creates a new ipa-advise command, available to root user on the IPA server. Also provides an example configuration plugin, config-fedora-authconfig. https://fedorahosted.org/freeipa/ticket/3670
* Prevent error when running IPA commands with su/sudoAna Krivokapic2013-06-071-5/+5
| | | | https://fedorahosted.org/freeipa/ticket/3685
* Add tests for the help command & --help optionsPetr Viktorin2013-02-181-3/+6
| | | | | | | | | Move the parser setup from bootstrap_with_global_options to bootstrap, so all API objects have access to it. Add some CLI tests for the help system. Part of the effort for https://fedorahosted.org/freeipa/ticket/3060
* Mention `ipa COMMAND --help` as the preferred way to get command helpPetr Viktorin2013-02-181-1/+1
| | | | | | | | | This avoids the problem with ambiguous command/topic names. No functionality is changed; `ipa help <COMMAND>` still works as before if there's no topic with the same name. https://fedorahosted.org/freeipa/ticket/3247
* Store the OptionParser in the API, use it to print unified help messagesPetr Viktorin2013-02-181-0/+1
| | | | | | | | | Make `ipa -h` and `ipa help` output the same message. Since `ipa -h` output is generated by the OptionParser, we need to make the parser available. Store it in `api.parser`. Part of the effort for https://fedorahosted.org/freeipa/ticket/3060
* Improve `ipa --help` outputPetr Viktorin2013-02-181-7/+30
| | | | | | | | | | | | | | | Fix the usage string to match actual usage. Add command description. Put information about `ipa help topics` etc. to the epilog, instead of using empty option groups. Use a custom formatter to preserve newlines. Add the -h/--help option manually to ensure consistent case (capital S). Part of the effort for https://fedorahosted.org/freeipa/ticket/3060
* Disallow setattr on no_update/no_create paramsPetr Viktorin2012-05-291-1/+1
| | | | | | | | | | | | | Make --{set,add,del}attr fail on parameters with the no_update/no_create flag for the respective command. For attributes that can be modified, but we just don't want to display in the CLI, use the 'no_option' flag. These are "locking" attributes (ipaenabledflag, nsaccountlock) and externalhost. Document the 'no_option' flag. Add some tests. https://fedorahosted.org/freeipa/ticket/2580
* Import the ipaserver plugins based on context, not env.in_server.Rob Crittenden2012-03-191-1/+1
| | | | | | | | | in_server controls how a method is dispatched, it should not also control what plugins are imported. This suppresses the error message "session memcached servers not running." https://fedorahosted.org/freeipa/ticket/2499
* Don't set delegation flag in client, we're using S4U2Proxy nowRob Crittenden2012-02-151-1/+4
| | | | | | | | | | | | 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
* Restore default log level in server to INFOJohn Dennis2011-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add plugin framework to LDAP updates.Rob Crittenden2011-11-221-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ticket 2022 - modify codebase to utilize IPALogManager, obsoletes loggingJohn Dennis2011-11-231-37/+29
| | | | | | | | | | | | 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()
* Finalize plugin initialization on demand.Jan Cholasta2011-11-221-6/+81
| | | | | | | | | | | | 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
* Cleanup whitespaceAlexander Bokovoy2011-09-131-3/+3
|
* Slight performance improvement by not doing some checking in production modeRob Crittenden2011-06-231-6/+12
| | | | | | These changes save a few hundred ms but every little bit helps. ticket 1023
* Final i18n unit test fixes.Pavel Zuna2011-03-011-2/+2
|
* Use pygettext to generate translatable strings from plugin files.Pavel Zuna2011-03-011-3/+2
| | | | | | | | | | | | 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.
* Fix translatable strings in ipalib plugins.Pavel Zuna2011-03-011-3/+5
| | | | Needed for xgettext/pygettext processing.
* Translate docstrings.Pavel Zuna2011-03-011-1/+1
|
* Add default success/failure output logging.Rob Crittenden2011-02-141-4/+8
| | | | | | | | | | 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
* Fix test failures caused by the performance patch.Rob Crittenden2011-02-101-6/+17
| | | | | | 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.
* Don't perform some API self-tests in production mode for performance reasonsRob Crittenden2011-01-281-5/+10
| | | | | | | | | | | | 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
* Don't require or create the log dirs if we're just validating the API.Rob Crittenden2011-01-141-1/+1
| | | | | Fixes an error displayed in the automated builds, plus we don't want a Makefile messing around with our homedir.
* 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
* Add support for client failover to the ipa command-line.Rob Crittenden2010-08-161-1/+6
| | | | | | | | | | | | 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
* Handle errors raised by plugins more gracefully in mod_wsgi.Rob Crittenden2010-07-121-2/+3
| | | | | | | | | | | | 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.
* Connect the -v cli argument to the verbose flag in xmlrpclibRob Crittenden2010-06-031-3/+3
| | | | | | 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.
* Add Object.label class attribute, enable in webUIJason Gerard DeRose2010-02-121-0/+17
|
* Fix logging in CLI and server (take 2)Jason Gerard DeRose2010-02-091-5/+10
|
* Only change the log level if it isn't already setRob Crittenden2010-02-031-4/+5
| | | | | | 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.
* Remove __public__ and __proxy__ hold-overs from Plugin classJason Gerard DeRose2010-01-281-72/+1
|
* Enabled CRUDS in webUI using wehjit 0.2.0Jason Gerard DeRose2010-01-261-0/+2
|
* If plugin fails to load log the tracebackJohn Dennis2009-11-231-1/+2
| | | | | | | | | | 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.
* Provide additional help to --help optionRob Crittenden2009-11-191-0/+7
|
* Make plugin browser show plugin parent classJason Gerard DeRose2009-10-141-0/+3
|
* Giant webui patch take 2Jason Gerard DeRose2009-10-131-1/+1
|
* Removed PluginProxy and all its usesJason Gerard DeRose2009-08-051-116/+1
|
* Modify PluginProxy to use __public__ defined in derived classes instead of ↵Pavel Zuna2009-06-101-1/+4
| | | | base classes.
* Rename errors2.py to errors.py. Modify all affected files.Pavel Zuna2009-04-231-10/+10
|
* Implemented more elegant way for entire plugin module to be conditionally ↵Jason Gerard DeRose2009-02-171-2/+36
| | | | skipped; updated cert.py and ra.py modules to use this
* Started cleanup work on ra plugin; fixed problem in api.bootstrap() when ↵Jason Gerard DeRose2009-02-171-2/+6
| | | | process does not have permision to open log file
* Started work on a much simplified mod_python serverJason Gerard DeRose2009-02-031-0/+2
|
* Finished reworked cli.CLI class into cli.cli pluginJason Gerard DeRose2009-02-031-5/+6
|
* Started reworking CLI class into cli pluginJason Gerard DeRose2009-02-031-5/+33
|
* Removed the depreciated Context and LazyContext classesJason Gerard DeRose2009-02-031-23/+0
|
* Added Object.params_minus() method; various small tweaksJason Gerard DeRose2009-02-031-7/+5
|
* Renamed all references to 'ipa_server' to 'ipaserver'Jason Gerard DeRose2009-01-041-1/+1
|