keystoneauth1.loading.base module

class keystoneauth1.loading.base.BaseLoader

Bases: object

property available

Return if the plugin is available for loading.

If a plugin is missing dependencies or for some other reason should not be available to the current system it should override this property and return False to exclude itself from the plugin list.

Return type:

bool

create_plugin(**kwargs)

Create a plugin from the options available for the loader.

Given the options that were specified by the loader create an appropriate plugin. You can override this function in your loader.

This used to be specified by providing the plugin_class property and this is still supported, however specifying a property didn’t let you choose a plugin type based upon the options that were presented.

Override this function if you wish to return different plugins based on the options presented, otherwise you can simply provide the plugin_class property.

Added 2.9

abstract get_options()

Return the list of parameters associated with the auth plugin.

This list may be used to generate CLI or config arguments.

Returns:

A list of Param objects describing available plugin parameters.

Return type:

list

load_from_options(**kwargs)

Create a plugin from the arguments retrieved from get_options.

A client can override this function to do argument validation or to handle differences between the registered options and what is required to create the plugin.

load_from_options_getter(getter, **kwargs)

Load a plugin from getter function that returns appropriate values.

To handle cases other than the provided CONF and CLI loading you can specify a custom loader function that will be queried for the option value. The getter is a function that takes a keystoneauth1.loading.Opt and returns a value to load with.

Parameters:

getter (callable) – A function that returns a value for the given opt.

Returns:

An authentication Plugin.

Return type:

keystoneauth1.plugin.BaseAuthPlugin

property plugin_class
keystoneauth1.loading.base.get_available_plugin_loaders()

Retrieve all the plugin classes available on the system.

Returns:

A dict with plugin entrypoint name as the key and the plugin loader as the value.

Return type:

dict

keystoneauth1.loading.base.get_available_plugin_names()

Get the names of all the plugins that are available on the system.

This is particularly useful for help and error text to prompt a user for example what plugins they may specify.

Returns:

A list of names.

Return type:

frozenset

keystoneauth1.loading.base.get_plugin_loader(name)

Retrieve a plugin class by its entrypoint name.

Parameters:

name (str) – The name of the object to get.

Returns:

An auth plugin class.

Return type:

keystoneauth1.loading.BaseLoader

Raises:

keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin – if a plugin cannot be created.

keystoneauth1.loading.base.get_plugin_options(name)

Get the options for a specific plugin.

This will be the list of options that is registered and loaded by the specified plugin.

Returns:

A list of keystoneauth1.loading.Opt options.

Raises:

keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin – if a plugin cannot be created.