summaryrefslogtreecommitdiffstats
path: root/ipsilon/util/plugin.py
Commit message (Collapse)AuthorAgeFilesLines
* Do not crash on failure to load configSimo Sorce2015-02-241-1/+5
| | | | | | | Just report an error and continue with default values. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Fix file permissions and remove shebang'sHEADmasterPatrick Uiterwijk2014-12-161-2/+0
| | | | | Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Return proper errors if config is read-onlySimo Sorce2014-11-121-0/+8
| | | | | | | | Do not throw 501 errors, instead return warnings that the configuration changes cannot be applied. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Refactor plugin initialization and enablementSimo Sorce2014-11-121-43/+94
| | | | | | | | | | | | Move most plugin enablement and initialization code in plugin.py to reduce code duplication and simplify and unifify plugin enablement for all base plugin types (login, info, providers). This patch breaks backwards compatibility as it changes how the list of enabled plugins is stored in the database tables. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Refactor plugin configurationSimo Sorce2014-11-121-63/+44
| | | | | | | | | | | | | | | Fork a PluginConfig class out of PluginObject, the base object now supports a simple dictionary config, while using PluginConfig provide access to structured util.config based configuration. Change UI code that deal with plugins configuration to properly use the new structured config objects in order to represent data in appropriate format based on the data type. Use the new util.config objects to represent plugins configuration. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Properly handle empty values in storageSimo Sorce2014-10-241-1/+1
| | | | | | | | Do not return default values if an actual empty string is found in the database. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Handle lists type options in plugins configurationSimo Sorce2014-10-241-0/+24
| | | | | | | | Autodetect and convert config values based on the options definition. If the option is marked as list split a string on setting the configuration or join the list into a string before saving it to the database. Signed-off-by: Simo Sorce <simo@redhat.com>
* Do not overwrite default plugin optionsSimo Sorce2014-10-241-2/+12
| | | | | | | | | Change the admin plugin to not overwrite the plugin default options, and only use the sanctioned pluginObject interfaces to read/write config values. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Refactor the data store a bitSimo Sorce2014-09-241-9/+15
| | | | | | | | | | | Reduce code duplication, and clearly separates admin and user dbs. Move plugin wrapper away and let plugin code use native functions. This patch also changes the indexed data to use a uuid and assumes 2 identical uuid cannot be created concurrently. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Use new Log class everywhereSimo Sorce2014-08-271-1/+2
| | | | | | | | | Replace copies of _debug function sprinkled all over the code with a single implementation Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com> - Removed replace of self._debug to self.debug
* Fix E256 with stricter pep8 error checkerSimo Sorce2014-05-201-1/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add infrastructure to delete plugin data by idSimo Sorce2014-04-041-0/+3
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add racefree way to add a new unique data pointSimo Sorce2014-04-041-0/+3
| | | | | | | | | | | | | | Our schema gathers together data related to a service by using an ID column. This column cannot be unique or a primary key as the ID is repeated for each key/value pair in the datum group. Use a unique identifier to make sure we can let dqlite generate a new ID internally and then find out wat it is as race-free as possible. We keep this method in the data module so it can be changed later without affecting application logic. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add way to add data to the global login configSimo Sorce2014-03-201-0/+3
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add functions to wipe and save plugin config dataSimo Sorce2014-03-201-0/+9
| | | | | | | This way all is needed is to instantiate a proper PluginObject from any provider and just call its functions Signed-off-by: Simo Sorce <simo@redhat.com>
* Add server-install plugin configuration supportSimo Sorce2014-03-201-0/+10
| | | | | | | Automatically find plugins installed in the system and exposes their installation and configuration functions through the installer. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix default and example pathsSimo Sorce2014-03-131-6/+2
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add Service Provider classSimo Sorce2014-02-261-2/+3
| | | | | | This class allows to represent a service provider and its associated policy Signed-off-by: Simo Sorce <simo@redhat.com>
* Add provider plugins loaderSimo Sorce2014-02-241-0/+7
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Better infrastructure to load pluginsSimo Sorce2014-01-241-18/+75
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Use pep8 checkPetr Vobornik2014-01-241-0/+1
| | | | | Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Signed-off-by: Simo Sorce <simo@redhat.com>
* Use pylint checkPetr Vobornik2014-01-241-6/+6
| | | | | Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Rename src package to ipsilonSimo Sorce2014-01-241-0/+80
Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>