# keystoneauth1.loading.opts module

class keystoneauth1.loading.opts.Opt(name: str, type: type[Any] = <class 'str'>, help: str | None = None, secret: bool = False, dest: str | None = None, deprecated: list[Opt] | None = None, default: Any = 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.

  __annotate_func__ = None
  __annotations_cache__ = {}
  __dict__ = mappingproxy({'__module__': 'keystoneauth1.loading.opts', '__firstlineno__': 23, '__doc__': "An option required by an authentication plugin.\n\nOpts provide a means for authentication plugins that are going to be\ndynamically loaded to specify the parameters that are to be passed to the\nplugin on initialization.\n\nThe Opt specifies information about the way the plugin parameter is to be\nrepresented in different loading mechanisms.\n\nWhen defining an Opt with a - the - should be present in the name\nparameter. This will automatically be converted to an _ when passing to the\nplugin initialization. For example, you should specify::\n\n Opt('user-domain-id')\n\nwhich will pass the value as `user_domain_id` to the plugin's\ninitialization.\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_envvars': <property object>, 'argparse_default': <property object>, '__static_attributes__': ('default', 'deprecated', 'deprecated_for_removal', 'deprecated_opts', 'dest', 'group', 'help', 'metavar', 'name', 'prompt', 'required', 'sample_default', 'secret', 'type'), '__dict__': <attribute '__dict__' of 'Opt' objects>, '__weakref__': <attribute '__weakref__' of 'Opt' objects>, '__hash__': None, '__annotate_func__': None, '__annotations_cache__': {}})
  __doc__ = "An option required by an authentication plugin.\n\nOpts provide a means for authentication plugins that are going to be\ndynamically loaded to specify the parameters that are to be passed to the\nplugin on initialization.\n\nThe Opt specifies information about the way the plugin parameter is to be\nrepresented in different loading mechanisms.\n\nWhen defining an Opt with a - the - should be present in the name\nparameter. This will automatically be converted to an _ when passing to the\nplugin initialization. For example, you should specify::\n\n Opt('user-domain-id')\n\nwhich will pass the value as `user_domain_id` to the plugin's\ninitialization.\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"
  __eq__(other: Any) → bool

    Define equality operator on option parameters.

  __firstlineno__ = 23
  __hash__ = None
  __init__(name: str, type: type[Any] = <class 'str'>, help: str | None = None, secret: bool = False, dest: str | None = None, deprecated: list[Opt] | None = None, default: Any = None, metavar: str | None = None, required: bool = False, prompt: str | None = None)
  __module__ = 'keystoneauth1.loading.opts'
  __repr__() → str

    Return string representation of option name.

  __static_attributes__ = ('default', 'deprecated', 'deprecated_for_removal', 'deprecated_opts', 'dest', 'group', 'help', 'metavar', 'name', 'prompt', 'required', 'sample_default', 'secret', 'type')
  __weakref__

    list of weak references to the object

  property _all_opts: chain[Opt]
  _to_oslo_opt() → cfg.Opt
  property argparse_args: list[str]
  property argparse_default: Any
  property argparse_envvars: list[str]

this page last updated: 2026-07-14 15:48:40

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug