keystoneauth1.loading.cli module

class keystoneauth1.loading.cli.Any(*args, **kwargs)

Bases: object

Special type indicating an unconstrained type.

  • Any is assignable to every type.

  • Any assumed to have all methods and attributes.

  • All values are assignable to Any.

Note that all the above statements are true from the point of view of static type checkers. At runtime, Any cannot be used with instance checks.

__annotations_cache__ = {}
__dict__ = mappingproxy({'__module__': 'typing', '__firstlineno__': 588, '__doc__': 'Special type indicating an unconstrained type.\n\n- Any is assignable to every type.\n- Any assumed to have all methods and attributes.\n- All values are assignable to Any.\n\nNote that all the above statements are true from the point of view of\nstatic type checkers. At runtime, Any cannot be used with instance\nchecks.\n', '__new__': <staticmethod(<function Any.__new__>)>, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'Any' objects>, '__weakref__': <attribute '__weakref__' of 'Any' objects>, '__annotations_cache__': {}})
__doc__ = 'Special type indicating an unconstrained type.\n\n- Any is assignable to every type.\n- Any assumed to have all methods and attributes.\n- All values are assignable to Any.\n\nNote that all the above statements are true from the point of view of\nstatic type checkers. At runtime, Any cannot be used with instance\nchecks.\n'
__firstlineno__ = 588
__module__ = 'typing'
static __new__(cls, *args, **kwargs)
__static_attributes__ = ()
__weakref__

list of weak references to the object

keystoneauth1.loading.cli._register_plugin_argparse_arguments(parser: ArgumentParser | _ArgumentGroup, plugin: BaseLoader[plugin.BaseAuthPluginT]) → None
keystoneauth1.loading.cli.load_from_argparse_arguments(namespace: Namespace, **kwargs: Any) → plugin.BaseAuthPluginT | None

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 – The result from CLI parsing.

Returns:

An auth plugin, or None if a name is not provided.

Raises:

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

keystoneauth1.loading.cli.register_argparse_arguments(parser: ArgumentParser, argv: list[str], default: Any = None) → BaseLoader[plugin.BaseAuthPluginT] | None

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:
  • parser – the parser to attach argparse options to.

  • argv – the arguments provided to the application.

  • default – 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.

Raises:

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