keystoneauth1.loading package

Submodules

keystoneauth1.loading.base module

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_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_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 keystonauth.exceptions.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 keystonauth.exceptions.NoMatchingPlugin:
 if a plugin cannot be created.
class keystoneauth1.loading.base.BaseLoader

Bases: object

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.

plugin_class

keystoneauth1.loading.cli module

keystoneauth1.loading.cli.register_argparse_arguments(*args, **kwargs)

Register CLI options needed to create a plugin.

The function inspects the provided arguments so that it can also register the options required for that specific plugin if available.

Parameters:
  • argparse.ArgumentParser – the parser to attach argparse options to.
  • argv (list) – the arguments provided to the appliation.
  • default (str/class) – a default plugin name or a plugin object to use if one isn’t specified by the CLI. default: None.
Returns:

The plugin class that will be loaded or None if not provided.

Return type:

keystonauth.auth.BaseAuthPlugin

Raises keystonauth.exceptions.NoMatchingPlugin:
 

if a plugin cannot be created.

keystoneauth1.loading.cli.load_from_argparse_arguments(namespace, **kwargs)

Retrieve the created plugin from the completed argparse results.

Loads and creates the auth plugin from the information parsed from the command line by argparse.

Parameters:namespace (Namespace) – The result from CLI parsing.
Returns:An auth plugin, or None if a name is not provided.
Return type:keystonauth.auth.BaseAuthPlugin
Raises keystonauth.exceptions.NoMatchingPlugin:
 if a plugin cannot be created.

keystoneauth1.loading.conf module

keystoneauth1.loading.conf.get_common_conf_options()

Get the oslo_config options common for all auth plugins.

These may be useful without being registered for config file generation or to manipulate the options before registering them yourself.

The options that are set are:
auth_type:The name of the pluign to load.
auth_section:The config file section to load options from.
Returns:A list of oslo_config options.
keystoneauth1.loading.conf.get_plugin_conf_options(name)

Get the oslo_config options for a specific plugin.

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

Returns:A list of oslo_config options.
keystoneauth1.loading.conf.register_conf_options(conf, group)

Register the oslo_config options that are needed for a plugin.

This only registers the basic options shared by all plugins. Options that are specific to a plugin are loaded just before they are read.

The defined options are:

  • auth_type: the name of the auth plugin that will be used for

    authentication.

  • auth_section: the group from which further auth plugin options should be

    taken. If section is not provided then the auth plugin options will be taken from the same group as provided in the parameters.

Parameters:
keystoneauth1.loading.conf.load_from_conf_options(conf, group, **kwargs)

Load a plugin from an oslo_config CONF object.

Each plugin will register their own required options and so there is no standard list and the plugin should be consulted.

The base options should have been registered with register_conf_options before this function is called.

Parameters:
Returns:

An authentication Plugin or None if a name is not provided

Return type:

keystonauth.auth.BaseAuthPlugin

Raises keystonauth.exceptions.NoMatchingPlugin:
 

if a plugin cannot be created.

keystoneauth1.loading.opts module

class keystoneauth1.loading.opts.Opt(*args, **kwargs)

Bases: object

argparse_args
argparse_default

keystoneauth1.loading.session module

keystoneauth1.loading.session.register_argparse_arguments(*args, **kwargs)
keystoneauth1.loading.session.load_from_argparse_arguments(*args, **kwargs)
keystoneauth1.loading.session.register_conf_options(*args, **kwargs)
keystoneauth1.loading.session.load_from_conf_options(*args, **kwargs)
keystoneauth1.loading.session.get_conf_options(*args, **kwargs)

Module contents

class keystoneauth1.loading.BaseLoader

Bases: object

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.

plugin_class
keystoneauth1.loading.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.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.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 keystonauth.exceptions.NoMatchingPlugin:
 if a plugin cannot be created.
keystoneauth1.loading.register_auth_argparse_arguments(*args, **kwargs)

Register CLI options needed to create a plugin.

The function inspects the provided arguments so that it can also register the options required for that specific plugin if available.

Parameters:
  • argparse.ArgumentParser – the parser to attach argparse options to.
  • argv (list) – the arguments provided to the appliation.
  • default (str/class) – a default plugin name or a plugin object to use if one isn’t specified by the CLI. default: None.
Returns:

The plugin class that will be loaded or None if not provided.

Return type:

keystonauth.auth.BaseAuthPlugin

Raises keystonauth.exceptions.NoMatchingPlugin:
 

if a plugin cannot be created.

keystoneauth1.loading.load_auth_from_argparse_arguments(namespace, **kwargs)

Retrieve the created plugin from the completed argparse results.

Loads and creates the auth plugin from the information parsed from the command line by argparse.

Parameters:namespace (Namespace) – The result from CLI parsing.
Returns:An auth plugin, or None if a name is not provided.
Return type:keystonauth.auth.BaseAuthPlugin
Raises keystonauth.exceptions.NoMatchingPlugin:
 if a plugin cannot be created.
keystoneauth1.loading.get_auth_common_conf_options()

Get the oslo_config options common for all auth plugins.

These may be useful without being registered for config file generation or to manipulate the options before registering them yourself.

The options that are set are:
auth_type:The name of the pluign to load.
auth_section:The config file section to load options from.
Returns:A list of oslo_config options.
keystoneauth1.loading.get_auth_plugin_conf_options(name)

Get the oslo_config options for a specific plugin.

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

Returns:A list of oslo_config options.
keystoneauth1.loading.register_auth_conf_options(conf, group)

Register the oslo_config options that are needed for a plugin.

This only registers the basic options shared by all plugins. Options that are specific to a plugin are loaded just before they are read.

The defined options are:

  • auth_type: the name of the auth plugin that will be used for

    authentication.

  • auth_section: the group from which further auth plugin options should be

    taken. If section is not provided then the auth plugin options will be taken from the same group as provided in the parameters.

Parameters:
keystoneauth1.loading.load_auth_from_conf_options(conf, group, **kwargs)

Load a plugin from an oslo_config CONF object.

Each plugin will register their own required options and so there is no standard list and the plugin should be consulted.

The base options should have been registered with register_conf_options before this function is called.

Parameters:
Returns:

An authentication Plugin or None if a name is not provided

Return type:

keystonauth.auth.BaseAuthPlugin

Raises keystonauth.exceptions.NoMatchingPlugin:
 

if a plugin cannot be created.

keystoneauth1.loading.register_session_argparse_arguments(*args, **kwargs)
keystoneauth1.loading.load_session_from_argparse_arguments(*args, **kwargs)
keystoneauth1.loading.register_session_conf_options(*args, **kwargs)
keystoneauth1.loading.load_session_from_conf_options(*args, **kwargs)
keystoneauth1.loading.get_session_conf_options(*args, **kwargs)
class keystoneauth1.loading.Opt(*args, **kwargs)

Bases: object

argparse_args
argparse_default