Docstrings should have :returns: everywhere.

Some of the docstrings have ``:return:`` instead of ``:returns:``
keyword. This patch fixes that and make it consistent.

Change-Id: I4321a63798ab9e2abdf0bbd716bf2b995be22ba3
This commit is contained in:
Marek Denis
2014-10-15 13:34:19 +02:00
parent 89dc951f7d
commit 8b267842a7
7 changed files with 10 additions and 9 deletions

View File

@@ -291,7 +291,8 @@ class _VersionHacks(object):
:param str service_type: the service_type to look up. :param str service_type: the service_type to look up.
:param str url: The original url that came from a service_catalog. :param str url: The original url that came from a service_catalog.
:return: Either the unversioned url or the one from the catalog to try. :returns: Either the unversioned url or the one from the catalog
to try.
""" """
for old, new in self._discovery_data.get(service_type, []): for old, new in self._discovery_data.get(service_type, []):
new_string, number_of_subs_made = old.subn(new, url) new_string, number_of_subs_made = old.subn(new, url)
@@ -313,6 +314,6 @@ def get_catalog_discover_hack(service_type, url):
:param str service_type: the service_type to look up. :param str service_type: the service_type to look up.
:param str url: The original url that came from a service_catalog. :param str url: The original url that came from a service_catalog.
:return: Either the unversioned url or the one from the catalog to try. :returns: Either the unversioned url or the one from the catalog to try.
""" """
return _VERSION_HACKS.get_discover_hack(service_type, url) return _VERSION_HACKS.get_discover_hack(service_type, url)

View File

@@ -83,7 +83,7 @@ class AccessInfo(dict):
def will_expire_soon(self, stale_duration=None): def will_expire_soon(self, stale_duration=None):
"""Determines if expiration is about to occur. """Determines if expiration is about to occur.
:return: boolean : true if expiration is within the given duration :returns: boolean : true if expiration is within the given duration
""" """
stale_duration = (STALE_TOKEN_DURATION if stale_duration is None stale_duration = (STALE_TOKEN_DURATION if stale_duration is None
@@ -100,7 +100,7 @@ class AccessInfo(dict):
"""Determines if processing v2 or v3 token given a successful """Determines if processing v2 or v3 token given a successful
auth body or a user-provided dict. auth body or a user-provided dict.
:return: boolean : true if auth body matches implementing class :returns: boolean : true if auth body matches implementing class
""" """
raise NotImplementedError() raise NotImplementedError()

View File

@@ -243,7 +243,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin):
:raises: DiscoveryFailure if for some reason the lookup fails. :raises: DiscoveryFailure if for some reason the lookup fails.
:raises: HttpError An error from an invalid HTTP response. :raises: HttpError An error from an invalid HTTP response.
:return: A discovery object with the results of looking up that URL. :returns: A discovery object with the results of looking up that URL.
""" """
# NOTE(jamielennox): we want to cache endpoints on the session as well # NOTE(jamielennox): we want to cache endpoints on the session as well
# so that they maintain sharing between auth plugins. Create a cache on # so that they maintain sharing between auth plugins. Create a cache on

View File

@@ -518,7 +518,7 @@ class ADFSUnscopedToken(_BaseSAMLPlugin):
and let Python raise the AttributeError. and let Python raise the AttributeError.
:param session :param session
:return: True if cookie jar is nonempty, False otherwise :returns: True if cookie jar is nonempty, False otherwise
:raises: AttributeError in case cookies are not find anywhere :raises: AttributeError in case cookies are not find anywhere
""" """

View File

@@ -1110,7 +1110,7 @@ class AuthProtocol(object):
:param retry: flag that forces the middleware to retry :param retry: flag that forces the middleware to retry
user authentication when an indeterminate user authentication when an indeterminate
response is received. Optional. response is received. Optional.
:return: token object received from keystone on success :returns: token object received from keystone on success
:raise InvalidUserToken: if token is rejected :raise InvalidUserToken: if token is rejected
:raise ServiceError: if unable to authenticate token :raise ServiceError: if unable to authenticate token

View File

@@ -204,7 +204,7 @@ def is_soon(dt, window):
:param dt: the time :param dt: the time
:param window: minimum seconds to remain to consider the time not soon :param window: minimum seconds to remain to consider the time not soon
:return: True if expiration is within the given duration :returns: True if expiration is within the given duration
""" """
soon = (utcnow() + datetime.timedelta(seconds=window)) soon = (utcnow() + datetime.timedelta(seconds=window))
return normalize_time(dt) <= soon return normalize_time(dt) <= soon

View File

@@ -48,7 +48,7 @@ class DoDiscoverTest(utils.TestCase):
def _execute_discover(self): def _execute_discover(self):
"""Call do_discover function and capture output """Call do_discover function and capture output
:return: captured output is returned :returns: captured output is returned
""" """
with mock.patch('sys.stdout', with mock.patch('sys.stdout',
new_callable=moves.StringIO) as mock_stdout: new_callable=moves.StringIO) as mock_stdout: