Cleanup docstrings

Several of these docstrings were referring to classes that didn't
exist. For example, they referenced keystonauth which doesn't
exist and is supposed to be keystoneauth1.

Change-Id: I070d32937c11b111f1821c466e8dfe55caadd748
This commit is contained in:
Brant Knudson 2016-02-19 13:52:16 -06:00
parent e250f99b5b
commit 417f2238ae
11 changed files with 125 additions and 120 deletions

View File

@ -14,11 +14,10 @@
The generators in this directory produce keystone compliant structures for use The generators in this directory produce keystone compliant structures for use
in testing. in testing.
They should be considered part of the public API because they may be relied They are part of the public API because they may be relied upon to generate
upon to generate test tokens for other clients. However they should never be test tokens for other clients. However they should never be imported into the
imported into the main client (keystonauth or other). Because of this there main client (keystoneauth or other). Because of this there may be dependencies
may be dependencies from this module on libraries that are only available in from this module on libraries that are only available in testing.
testing.
""" """
from keystoneauth1.fixture.discovery import * # noqa from keystoneauth1.fixture.discovery import * # noqa

View File

@ -27,7 +27,7 @@ class AccessInfoPlugin(base.BaseIdentityPlugin):
authorizing information. authorizing information.
:param auth_ref: the existing AccessInfo object. :param auth_ref: the existing AccessInfo object.
:type auth_ref: keystonauth.access.AccessInfo :type auth_ref: keystoneauth1.access.AccessInfo
:param auth_url: the url where this AccessInfo was retrieved from. Required :param auth_url: the url where this AccessInfo was retrieved from. Required
if using the AUTH_INTERFACE with get_endpoint. (optional) if using the AUTH_INTERFACE with get_endpoint. (optional)
""" """

View File

@ -61,16 +61,15 @@ class BaseIdentityPlugin(plugin.BaseAuthPlugin):
data then you should use get_access. data then you should use get_access.
:param session: A session object that can be used for communication. :param session: A session object that can be used for communication.
:type session: keystonauth.session.Session :type session: keystoneauth1.session.Session
:raises keystonauth.exceptions.InvalidResponse: The response :raises keystoneauth1.exceptions.response.InvalidResponse:
returned wasn't The response returned wasn't appropriate.
appropriate. :raises keystoneauth1.exceptions.http.HttpError:
:raises keystonauth.exceptions.HttpError: An error from an invalid An error from an invalid HTTP response.
HTTP response.
:returns: Token access information. :returns: Token access information.
:rtype: :py:class:`keystonauth.access.AccessInfo` :rtype: :class:`keystoneauth1.access.AccessInfo`
""" """
def get_token(self, session, **kwargs): def get_token(self, session, **kwargs):
@ -79,10 +78,10 @@ class BaseIdentityPlugin(plugin.BaseAuthPlugin):
If a valid token is not present then a new one will be fetched. If a valid token is not present then a new one will be fetched.
:param session: A session object that can be used for communication. :param session: A session object that can be used for communication.
:type session: keystonauth.session.Session :type session: keystoneauth1.session.Session
:raises keystonauth.exceptions.HttpError: An error from an invalid :raises keystoneauth1.exceptions.http.HttpError: An error from an
HTTP response. invalid HTTP response.
:return: A valid token. :return: A valid token.
:rtype: string :rtype: string
@ -118,13 +117,13 @@ class BaseIdentityPlugin(plugin.BaseAuthPlugin):
one will be fetched. one will be fetched.
:param session: A session object that can be used for communication. :param session: A session object that can be used for communication.
:type session: keystonauth.session.Session :type session: keystoneauth1.session.Session
:raises keystonauth.exceptions.HttpError: An error from an invalid :raises keystoneauth1.exceptions.http.HttpError: An error from an
HTTP response. invalid HTTP response.
:returns: Valid AccessInfo :returns: Valid AccessInfo
:rtype: :py:class:`keystonauth.access.AccessInfo` :rtype: :class:`keystoneauth1.access.AccessInfo`
""" """
# Hey Kids! Thread safety is important particularly in the case where # Hey Kids! Thread safety is important particularly in the case where
# a service is creating an admin style plugin that will then proceed # a service is creating an admin style plugin that will then proceed
@ -166,7 +165,7 @@ class BaseIdentityPlugin(plugin.BaseAuthPlugin):
the session and kwargs. the session and kwargs.
:param session: A session object that can be used for communication. :param session: A session object that can be used for communication.
:type session: keystonauth.session.Session :type session: keystoneauth1.session.Session
:param string service_type: The type of service to lookup the endpoint :param string service_type: The type of service to lookup the endpoint
for. This plugin will return None (failure) for. This plugin will return None (failure)
if service_type is not provided. if service_type is not provided.
@ -182,8 +181,8 @@ class BaseIdentityPlugin(plugin.BaseAuthPlugin):
:param tuple version: The minimum version number required for this :param tuple version: The minimum version number required for this
endpoint. (optional) endpoint. (optional)
:raises keystonauth.exceptions.HttpError: An error from an invalid :raises keystoneauth1.exceptions.http.HttpError: An error from an
HTTP response. invalid HTTP response.
:return: A valid endpoint URL or None if not available. :return: A valid endpoint URL or None if not available.
:rtype: string or None :rtype: string or None
@ -274,16 +273,16 @@ class BaseIdentityPlugin(plugin.BaseAuthPlugin):
be needed by users. be needed by users.
:param session: A session object to discover with. :param session: A session object to discover with.
:type session: keystonauth.session.Session :type session: keystoneauth1.session.Session
:param str url: The url to lookup. :param str url: The url to lookup.
:param bool authenticated: Include a token in the discovery call. :param bool authenticated: Include a token in the discovery call.
(optional) Defaults to None (use a token (optional) Defaults to None (use a token
if a plugin is installed). if a plugin is installed).
:raises keystonauth.exceptions.DiscoveryFailure: if for some reason :raises keystoneauth1.exceptions.discovery.DiscoveryFailure:
the lookup fails. if for some reason the lookup fails.
:raises keystonauth.exceptions.HttpError: An error from an invalid :raises keystoneauth1.exceptions.http.HttpError: An error from an
HTTP response. invalid HTTP response.
:returns: A discovery object with the results of looking up that URL. :returns: A discovery object with the results of looking up that URL.
""" """

View File

@ -60,7 +60,7 @@ class BaseGenericPlugin(base.BaseIdentityPlugin):
@abc.abstractmethod @abc.abstractmethod
def create_plugin(self, session, version, url, raw_status=None): def create_plugin(self, session, version, url, raw_status=None):
"""Create a plugin from the given paramters. """Create a plugin from the given parameters.
This function will be called multiple times with the version and url This function will be called multiple times with the version and url
of a potential endpoint. If a plugin can be constructed that fits the of a potential endpoint. If a plugin can be constructed that fits the
@ -68,10 +68,10 @@ class BaseGenericPlugin(base.BaseIdentityPlugin):
call will be made with other available URLs. call will be made with other available URLs.
:param session: A session object. :param session: A session object.
:type session: keystonauth.session.Session :type session: keystoneauth1.session.Session
:param tuple version: A tuple of the API version at the URL. :param tuple version: A tuple of the API version at the URL.
:param string url: The base URL for this version. :param str url: The base URL for this version.
:param string raw_status: The status that was in the discovery field. :param str raw_status: The status that was in the discovery field.
:returns: A plugin that can match the parameters or None if nothing. :returns: A plugin that can match the parameters or None if nothing.
""" """

View File

@ -235,7 +235,7 @@ class AuthMethod(object):
"""Return the authentication section of an auth plugin. """Return the authentication section of an auth plugin.
:param session: The communication session. :param session: The communication session.
:type session: keystonauth.session.Session :type session: keystoneauth1.session.Session
:param Auth auth: The auth plugin calling the method. :param Auth auth: The auth plugin calling the method.
:param dict headers: The headers that will be sent with the auth :param dict headers: The headers that will be sent with the auth
request if a plugin needs to add to them. request if a plugin needs to add to them.

View File

@ -56,10 +56,10 @@ class _Rescoped(base.BaseAuth):
is present then the token is rescoped to that target. is present then the token is rescoped to that target.
:param session: a session object to send out HTTP requests. :param session: a session object to send out HTTP requests.
:type session: keystonauth.session.Session :type session: keystoneauth1.session.Session
:returns: a token data representation :returns: a token data representation
:rtype: :py:class:`keystonauth.access.AccessInfo` :rtype: :py:class:`keystoneauth1.access.AccessInfo`
""" """
auth_ref = self.get_unscoped_auth_ref(session) auth_ref = self.get_unscoped_auth_ref(session)

View File

@ -79,7 +79,7 @@ class _OidcBase(federation.FederationBaseAuth):
"""Exchange a variety of user supplied values for an access token. """Exchange a variety of user supplied values for an access token.
:param session: a session object to send out HTTP requests. :param session: a session object to send out HTTP requests.
:type session: keystoneauth.session.Session :type session: keystoneauth1.session.Session
:param client_auth: a tuple representing client id and secret :param client_auth: a tuple representing client id and secret
:type client_auth: tuple :type client_auth: tuple
@ -112,7 +112,7 @@ class _OidcBase(federation.FederationBaseAuth):
succeed, a Keystone token will be presented to the user. succeed, a Keystone token will be presented to the user.
:param session: a session object to send out HTTP requests. :param session: a session object to send out HTTP requests.
:type session: keystoneauth.session.Session :type session: keystoneauth1.session.Session
:param headers: an Authorization header containing the access token. :param headers: an Authorization header containing the access token.
:type headers_: dict :type headers_: dict

View File

@ -63,8 +63,8 @@ def get_plugin_loader(name):
:returns: An auth plugin class. :returns: An auth plugin class.
:rtype: :py:class:`keystoneauth1.loading.BaseLoader` :rtype: :py:class:`keystoneauth1.loading.BaseLoader`
:raises keystonauth.exceptions.NoMatchingPlugin: if a plugin cannot be :raises keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin:
created. if a plugin cannot be created.
""" """
try: try:
mgr = stevedore.DriverManager(namespace=PLUGIN_NAMESPACE, mgr = stevedore.DriverManager(namespace=PLUGIN_NAMESPACE,
@ -84,8 +84,8 @@ def get_plugin_options(name):
:returns: A list of :py:class:`keystoneauth1.loading.Opt` options. :returns: A list of :py:class:`keystoneauth1.loading.Opt` options.
:raises keystonauth.exceptions.NoMatchingPlugin: if a plugin cannot be :raises keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin:
created. if a plugin cannot be created.
""" """
return get_plugin_loader(name).get_options() return get_plugin_loader(name).get_options()

View File

@ -38,16 +38,17 @@ def register_argparse_arguments(parser, argv, default=None):
The function inspects the provided arguments so that it can also register The function inspects the provided arguments so that it can also register
the options required for that specific plugin if available. the options required for that specific plugin if available.
:param argparse.ArgumentParser: the parser to attach argparse options to. :param parser: the parser to attach argparse options to.
:type parser: argparse.ArgumentParser
:param list argv: the arguments provided to the appliation. :param list argv: the arguments provided to the appliation.
:param str/class default: a default plugin name or a plugin object to use :param str/class default: a default plugin name or a plugin object to use
if one isn't specified by the CLI. default: None. if one isn't specified by the CLI. default: None.
:returns: The plugin class that will be loaded or None if not provided. :returns: The plugin class that will be loaded or None if not provided.
:rtype: :py:class:`keystonauth.auth.BaseAuthPlugin` :rtype: :class:`keystoneauth1.plugin.BaseAuthPlugin`
:raises keystonauth.exceptions.NoMatchingPlugin: if a plugin cannot be :raises keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin:
created. if a plugin cannot be created.
""" """
in_parser = argparse.ArgumentParser(add_help=False) in_parser = argparse.ArgumentParser(add_help=False)
env_plugin = os.environ.get('OS_AUTH_TYPE', env_plugin = os.environ.get('OS_AUTH_TYPE',
@ -85,10 +86,10 @@ def load_from_argparse_arguments(namespace, **kwargs):
:param Namespace namespace: The result from CLI parsing. :param Namespace namespace: The result from CLI parsing.
:returns: An auth plugin, or None if a name is not provided. :returns: An auth plugin, or None if a name is not provided.
:rtype: :py:class:`keystonauth.auth.BaseAuthPlugin` :rtype: :class:`keystoneauth1.plugin.BaseAuthPlugin`
:raises keystonauth.exceptions.NoMatchingPlugin: if a plugin cannot be :raises keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin:
created. if a plugin cannot be created.
""" """
if not namespace.os_auth_type: if not namespace.os_auth_type:
return None return None

View File

@ -105,13 +105,13 @@ def load_from_conf_options(conf, group, **kwargs):
:param conf: A conf object. :param conf: A conf object.
:type conf: oslo_config.cfg.ConfigOpts :type conf: oslo_config.cfg.ConfigOpts
:param string group: The group name that options should be read from. :param str group: The group name that options should be read from.
:returns: An authentication Plugin or None if a name is not provided :returns: An authentication Plugin or None if a name is not provided
:rtype: :py:class:`keystonauth.auth.BaseAuthPlugin` :rtype: :class:`keystoneauth1.plugin.BaseAuthPlugin`
:raises keystonauth.exceptions.NoMatchingPlugin: if a plugin cannot be :raises keystoneauth1.exceptions.auth_plugins.NoMatchingPlugin:
created. if a plugin cannot be created.
""" """
# NOTE(jamielennox): plugins are allowed to specify a 'section' which is # NOTE(jamielennox): plugins are allowed to specify a 'section' which is
# the group that auth options should be taken from. If not present they # the group that auth options should be taken from. If not present they

View File

@ -97,16 +97,16 @@ class Session(object):
"""Maintains client communication state and common functionality. """Maintains client communication state and common functionality.
As much as possible the parameters to this class reflect and are passed As much as possible the parameters to this class reflect and are passed
directly to the requests library. directly to the :mod:`requests` library.
:param auth: An authentication plugin to authenticate the session with. :param auth: An authentication plugin to authenticate the session with.
(optional, defaults to None) (optional, defaults to None)
:type auth: :py:class:`keystonauth.auth.base.BaseAuthPlugin` :type auth: keystoneauth1.plugin.BaseAuthPlugin
:param requests.Session session: A requests session object that can be used :param requests.Session session: A requests session object that can be used
for issuing requests. (optional) for issuing requests. (optional)
:param string original_ip: The original IP of the requesting user which :param str original_ip: The original IP of the requesting user which will
will be sent to identity service in a be sent to identity service in a 'Forwarded'
'Forwarded' header. (optional) header. (optional)
:param verify: The verification arguments to pass to requests. These are of :param verify: The verification arguments to pass to requests. These are of
the same form as requests expects, so True or False to the same form as requests expects, so True or False to
verify (or not) against system certificates or a path to a verify (or not) against system certificates or a path to a
@ -121,13 +121,13 @@ class Session(object):
numerical value indicating some amount (or fraction) numerical value indicating some amount (or fraction)
of seconds or 0 for no timeout. (optional, defaults of seconds or 0 for no timeout. (optional, defaults
to 0) to 0)
:param string user_agent: A User-Agent header string to use for the :param str user_agent: A User-Agent header string to use for the request.
request. If not provided, a default of If not provided, a default of
:attr:`~keystoneauth1.session.DEFAULT_USER_AGENT` :attr:`~keystoneauth1.session.DEFAULT_USER_AGENT` is
is used, which contains the keystoneauth1 version used, which contains the keystoneauth1 version as
as well as those of the requests library and well as those of the requests library and which
which Python is being used. When a non-None value Python is being used. When a non-None value is
is passed, it will be prepended to the default. passed, it will be prepended to the default.
:param int/bool redirect: Controls the maximum number of redirections that :param int/bool redirect: Controls the maximum number of redirections that
can be followed by a request. Either an integer can be followed by a request. Either an integer
for a specific count or True/False for for a specific count or True/False for
@ -291,19 +291,18 @@ class Session(object):
Arguments that are not handled are passed through to the requests Arguments that are not handled are passed through to the requests
library. library.
:param string url: Path or fully qualified URL of HTTP request. If only :param str url: Path or fully qualified URL of HTTP request. If only a
a path is provided then endpoint_filter must also be path is provided then endpoint_filter must also be
provided such that the base URL can be determined. provided such that the base URL can be determined. If a
If a fully qualified URL is provided then fully qualified URL is provided then endpoint_filter
endpoint_filter will be ignored. will be ignored.
:param string method: The http method to use. (e.g. 'GET', 'POST') :param str method: The http method to use. (e.g. 'GET', 'POST')
:param string original_ip: Mark this request as forwarded for this ip. :param str original_ip: Mark this request as forwarded for this ip.
(optional) (optional)
:param dict headers: Headers to be included in the request. (optional) :param dict headers: Headers to be included in the request. (optional)
:param json: Some data to be represented as JSON. (optional) :param json: Some data to be represented as JSON. (optional)
:param string user_agent: A user_agent to use for the request. If :param str user_agent: A user_agent to use for the request. If present
present will override one present in headers. will override one present in headers. (optional)
(optional)
:param int/bool redirect: the maximum number of redirections that :param int/bool redirect: the maximum number of redirections that
can be followed by a request. Either an can be followed by a request. Either an
integer for a specific count or True/False integer for a specific count or True/False
@ -325,14 +324,14 @@ class Session(object):
ignored if a fully qualified URL is ignored if a fully qualified URL is
provided but take priority over an provided but take priority over an
endpoint_filter. This string may contain endpoint_filter. This string may contain
the values %(project_id)s and %(user_id)s the values ``%(project_id)s`` and
to have those values replaced by the ``%(user_id)s`` to have those values
project_id/user_id of the current replaced by the project_id/user_id of the
authentication. (optional) current authentication. (optional)
:param auth: The auth plugin to use when authenticating this request. :param auth: The auth plugin to use when authenticating this request.
This will override the plugin that is attached to the This will override the plugin that is attached to the
session (if any). (optional) session (if any). (optional)
:type auth: :py:class:`keystonauth.auth.base.BaseAuthPlugin` :type auth: keystoneauth1.plugin.BaseAuthPlugin
:param requests_auth: A requests library auth plugin that cannot be :param requests_auth: A requests library auth plugin that cannot be
passed via kwarg because the `auth` kwarg passed via kwarg because the `auth` kwarg
collides with our own auth plugins. (optional) collides with our own auth plugins. (optional)
@ -346,16 +345,19 @@ class Session(object):
:param bool log: If True then log the request and response data to the :param bool log: If True then log the request and response data to the
debug log. (optional, default True) debug log. (optional, default True)
:param logger: The logger object to use to log request and responses. :param logger: The logger object to use to log request and responses.
If not provided the keystonauth.session default If not provided the keystoneauth1.session default
logger will be used. logger will be used.
:type logger: logging.Logger :type logger: logging.Logger
:param kwargs: any other parameter that can be passed to :param kwargs: any other parameter that can be passed to
requests.Session.request (such as `headers`). Except: :meth:`requests.Session.request` (such as `headers`).
'data' will be overwritten by the data in 'json' param. Except:
'allow_redirects' is ignored as redirects are handled
by the session.
:raises keystonauth.exceptions.ClientException: For connection - `data` will be overwritten by the data in the `json`
param.
- `allow_redirects` is ignored as redirects are handled
by the session.
:raises keystoneauth1.exceptions.base.ClientException: For connection
failure, or to indicate an error response code. failure, or to indicate an error response code.
:returns: The response to the request. :returns: The response to the request.
@ -610,15 +612,15 @@ class Session(object):
:param auth: The auth plugin to use for token. Overrides the plugin :param auth: The auth plugin to use for token. Overrides the plugin
on the session. (optional) on the session. (optional)
:type auth: :py:class:`keystonauth.auth.base.BaseAuthPlugin` :type auth: keystoneauth1.plugin.BaseAuthPlugin
:raises keystonauth.exceptions.AuthorizationFailure: if a new token :raises keystoneauth1.exceptions.auth.AuthorizationFailure:
fetch fails. if a new token fetch fails.
:raises keystonauth.exceptions.MissingAuthPlugin: if a plugin is not :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
available. if a plugin is not available.
:returns: Authentication headers or None for failure. :returns: Authentication headers or None for failure.
:rtype: dict :rtype: :class:`dict`
""" """
auth = self._auth_required(auth, 'fetch a token') auth = self._auth_required(auth, 'fetch a token')
return auth.get_headers(self, **kwargs) return auth.get_headers(self, **kwargs)
@ -628,16 +630,17 @@ class Session(object):
:param auth: The auth plugin to use for token. Overrides the plugin :param auth: The auth plugin to use for token. Overrides the plugin
on the session. (optional) on the session. (optional)
:type auth: :py:class:`keystonauth.auth.base.BaseAuthPlugin` :type auth: keystoneauth1.plugin.BaseAuthPlugin
:raises keystonauth.exceptions.AuthorizationFailure: if a new token :raises keystoneauth1.exceptions.auth.AuthorizationFailure:
fetch fails. if a new token fetch fails.
:raises keystonauth.exceptions.MissingAuthPlugin: if a plugin is not :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
available. if a plugin is not available.
*DEPRECATED*: This assumes that the only header that is used to .. warning::
authenticate a message is 'X-Auth-Token'. This may not be **DEPRECATED**: This assumes that the only header that is used to
correct. Use get_auth_headers instead. authenticate a message is ``X-Auth-Token``. This may not be
correct. Use :meth:`get_auth_headers` instead.
:returns: A valid token. :returns: A valid token.
:rtype: string :rtype: string
@ -649,10 +652,10 @@ class Session(object):
:param auth: The auth plugin to use for token. Overrides the plugin on :param auth: The auth plugin to use for token. Overrides the plugin on
the session. (optional) the session. (optional)
:type auth: :py:class:`keystonauth.auth.base.BaseAuthPlugin` :type auth: keystoneauth1.plugin.BaseAuthPlugin
:raises keystonauth.exceptions.MissingAuthPlugin: if a plugin is not :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
available. if a plugin is not available.
:returns: An endpoint if available or None. :returns: An endpoint if available or None.
:rtype: string :rtype: string
@ -680,17 +683,18 @@ class Session(object):
:param auth: The auth plugin to use for tokens. Overrides the plugin :param auth: The auth plugin to use for tokens. Overrides the plugin
on the session. (optional) on the session. (optional)
:type auth: keystoneclient.auth.base.BaseAuthPlugin :type auth: keystoneauth1.plugin.BaseAuthPlugin
:raises keystoneclient.exceptions.AuthorizationFailure: if a new token :raises keystoneauth1.exceptions.auth.AuthorizationFailure:
fetch fails. if a new token fetch fails.
:raises keystoneclient.exceptions.MissingAuthPlugin: if a plugin is not :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
available. if a plugin is not available.
:raises keystoneclient.exceptions.UnsupportedParameters: if the plugin :raises keystoneauth1.exceptions.auth_plugins.UnsupportedParameters:
returns a parameter that is not supported by this session. if the plugin returns a parameter that is not supported by this
session.
:returns: Authentication headers or None for failure. :returns: Authentication headers or None for failure.
:rtype: dict :rtype: :class:`dict`
""" """
msg = 'An auth plugin is required to fetch connection params' msg = 'An auth plugin is required to fetch connection params'
auth = self._auth_required(auth, msg) auth = self._auth_required(auth, msg)
@ -718,7 +722,7 @@ class Session(object):
:param auth: The auth plugin to invalidate. Overrides the plugin on the :param auth: The auth plugin to invalidate. Overrides the plugin on the
session. (optional) session. (optional)
:type auth: :py:class:`keystonauth.auth.base.BaseAuthPlugin` :type auth: keystoneauth1.plugin.BaseAuthPlugin
""" """
auth = self._auth_required(auth, 'validate') auth = self._auth_required(auth, 'validate')
@ -729,14 +733,15 @@ class Session(object):
:param auth: The auth plugin to use for token. Overrides the plugin :param auth: The auth plugin to use for token. Overrides the plugin
on the session. (optional) on the session. (optional)
:type auth: keystonauth.auth.base.BaseAuthPlugin :type auth: keystoneauth1.plugin.BaseAuthPlugin
:raises keystonauth.exceptions.AuthorizationFailure: :raises keystoneauth1.exceptions.auth.AuthorizationFailure:
if a new token fetch fails. if a new token fetch fails.
:raises keystonauth.exceptions.MissingAuthPlugin: :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
if a plugin is not available. if a plugin is not available.
:returns string: Current user_id or None if not supported by plugin. :returns: Current user_id or None if not supported by plugin.
:rtype: :class:`str`
""" """
auth = self._auth_required(auth, 'get user_id') auth = self._auth_required(auth, 'get user_id')
return auth.get_user_id(self) return auth.get_user_id(self)
@ -746,14 +751,15 @@ class Session(object):
:param auth: The auth plugin to use for token. Overrides the plugin :param auth: The auth plugin to use for token. Overrides the plugin
on the session. (optional) on the session. (optional)
:type auth: keystonauth.auth.base.BaseAuthPlugin :type auth: keystoneauth1.plugin.BaseAuthPlugin
:raises keystonauth.exceptions.AuthorizationFailure: :raises keystoneauth1.exceptions.auth.AuthorizationFailure:
if a new token fetch fails. if a new token fetch fails.
:raises keystonauth.exceptions.MissingAuthPlugin: :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
if a plugin is not available. if a plugin is not available.
:returns string: Current project_id or None if not supported by plugin. :returns: Current project_id or None if not supported by plugin.
:rtype: :class:`str`
""" """
auth = self._auth_required(auth, 'get project_id') auth = self._auth_required(auth, 'get project_id')
return auth.get_project_id(self) return auth.get_project_id(self)