keystoneauth1.loading.opts module¶
- class keystoneauth1.loading.opts.Opt(name: str, type: ~typing.Type[~typing.Any] = <class 'str'>, help: str | None = None, secret: bool = False, dest: str | None = None, deprecated: ~typing.List[~keystoneauth1.loading.opts.Opt] | None = None, default: ~typing.Any | None = None, metavar: str | None = None, required: bool = False, prompt: str | None = None)
Bases:
object
An option required by an authentication plugin.
Opts provide a means for authentication plugins that are going to be dynamically loaded to specify the parameters that are to be passed to the plugin on initialization.
The Opt specifies information about the way the plugin parameter is to be represented in different loading mechanisms.
When defining an Opt with a - the - should be present in the name parameter. This will automatically be converted to an _ when passing to the plugin initialization. For example, you should specify:
Opt('user-domain-id')
which will pass the value as user_domain_id to the plugin’s initialization.
- Parameters:
name (str) – The name of the option.
type (callable) – The type of the option. This is a callable which is passed the raw option that was loaded (often a string) and is required to return the parameter in the type expected by __init__.
help (str) – The help text that is shown along with the option.
secret (bool) – If the parameter is secret it should not be printed or logged in debug output.
dest (str) – the name of the argument that will be passed to __init__. This allows you to have a different name in loading than is used by the __init__ function. Defaults to the value of name.
deprecated (keystoneauth1.loading.Opt) – A list of other options that are deprecated in favour of this one. This ensures the old options are still registered.
default – A default value that can be used if one is not provided.
metavar (str) – The <metavar> that should be printed in CLI help text.
required (bool) – If the option is required to load the plugin. If a required option is not present loading should fail.
prompt (str) – If the option can be requested via a prompt (where appropriate) set the string that should be used to prompt with.
- __annotations__ = {}
- __dict__ = mappingproxy({'__module__': 'keystoneauth1.loading.opts', '__doc__': "An option required by an authentication plugin.\n\n Opts provide a means for authentication plugins that are going to be\n dynamically loaded to specify the parameters that are to be passed to the\n plugin on initialization.\n\n The Opt specifies information about the way the plugin parameter is to be\n represented in different loading mechanisms.\n\n When defining an Opt with a - the - should be present in the name\n parameter. This will automatically be converted to an _ when passing to the\n plugin initialization. For example, you should specify::\n\n Opt('user-domain-id')\n\n which will pass the value as `user_domain_id` to the plugin's\n initialization.\n\n :param str name: The name of the option.\n :param callable type: The type of the option. This is a callable which is\n passed the raw option that was loaded (often a string) and is required\n to return the parameter in the type expected by __init__.\n :param str help: The help text that is shown along with the option.\n :param bool secret: If the parameter is secret it should not be printed or\n logged in debug output.\n :param str dest: the name of the argument that will be passed to __init__.\n This allows you to have a different name in loading than is used by the\n __init__ function. Defaults to the value of name.\n :param keystoneauth1.loading.Opt deprecated: A list of other options that\n are deprecated in favour of this one. This ensures the old options are\n still registered.\n :type opt: list(Opt)\n :param default: A default value that can be used if one is not provided.\n :param str metavar: The <metavar> that should be printed in CLI help text.\n :param bool required: If the option is required to load the plugin. If a\n required option is not present loading should fail.\n :param str prompt: If the option can be requested via a prompt (where\n appropriate) set the string that should be used to prompt with.\n ", '__init__': <function Opt.__init__>, '__repr__': <function Opt.__repr__>, '_to_oslo_opt': <function Opt._to_oslo_opt>, '__eq__': <function Opt.__eq__>, '_all_opts': <property object>, 'argparse_args': <property object>, 'argparse_default': <property object>, '__dict__': <attribute '__dict__' of 'Opt' objects>, '__weakref__': <attribute '__weakref__' of 'Opt' objects>, '__hash__': None, '__annotations__': {}})
- __doc__ = "An option required by an authentication plugin.\n\n Opts provide a means for authentication plugins that are going to be\n dynamically loaded to specify the parameters that are to be passed to the\n plugin on initialization.\n\n The Opt specifies information about the way the plugin parameter is to be\n represented in different loading mechanisms.\n\n When defining an Opt with a - the - should be present in the name\n parameter. This will automatically be converted to an _ when passing to the\n plugin initialization. For example, you should specify::\n\n Opt('user-domain-id')\n\n which will pass the value as `user_domain_id` to the plugin's\n initialization.\n\n :param str name: The name of the option.\n :param callable type: The type of the option. This is a callable which is\n passed the raw option that was loaded (often a string) and is required\n to return the parameter in the type expected by __init__.\n :param str help: The help text that is shown along with the option.\n :param bool secret: If the parameter is secret it should not be printed or\n logged in debug output.\n :param str dest: the name of the argument that will be passed to __init__.\n This allows you to have a different name in loading than is used by the\n __init__ function. Defaults to the value of name.\n :param keystoneauth1.loading.Opt deprecated: A list of other options that\n are deprecated in favour of this one. This ensures the old options are\n still registered.\n :type opt: list(Opt)\n :param default: A default value that can be used if one is not provided.\n :param str metavar: The <metavar> that should be printed in CLI help text.\n :param bool required: If the option is required to load the plugin. If a\n required option is not present loading should fail.\n :param str prompt: If the option can be requested via a prompt (where\n appropriate) set the string that should be used to prompt with.\n "
- __hash__ = None
- __init__(name: str, type: ~typing.Type[~typing.Any] = <class 'str'>, help: str | None = None, secret: bool = False, dest: str | None = None, deprecated: ~typing.List[~keystoneauth1.loading.opts.Opt] | None = None, default: ~typing.Any | None = None, metavar: str | None = None, required: bool = False, prompt: str | None = None)
- __module__ = 'keystoneauth1.loading.opts'
- __repr__() str
Return string representation of option name.
- __weakref__
list of weak references to the object (if defined)
- property _all_opts: chain[Opt]
- _to_oslo_opt() cfg.Opt
- property argparse_default: Any