summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Denis <marek.denis@cern.ch>2014-10-15 13:34:19 +0200
committerMarek Denis <marek.denis@cern.ch>2014-10-15 13:34:19 +0200
commit8b267842a701970d4e1aae2f115afe4d73bc5ee6 (patch)
tree7e0d3a9c40a97c0da81f6312434aa11f74c243cd
parent89dc951f7d5a603f0c34b7c2cb9f7d26d73d9916 (diff)
downloadpython-keystoneclient-8b267842a701970d4e1aae2f115afe4d73bc5ee6.tar.gz
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
-rw-r--r--keystoneclient/_discover.py5
-rw-r--r--keystoneclient/access.py4
-rw-r--r--keystoneclient/auth/identity/base.py2
-rw-r--r--keystoneclient/contrib/auth/v3/saml2.py2
-rw-r--r--keystoneclient/middleware/auth_token.py2
-rw-r--r--keystoneclient/openstack/common/timeutils.py2
-rw-r--r--keystoneclient/tests/generic/test_shell.py2
7 files changed, 10 insertions, 9 deletions
diff --git a/keystoneclient/_discover.py b/keystoneclient/_discover.py
index c9c9792..8816209 100644
--- a/keystoneclient/_discover.py
+++ b/keystoneclient/_discover.py
@@ -291,7 +291,8 @@ class _VersionHacks(object):
:param str service_type: the service_type to look up.
: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, []):
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 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)
diff --git a/keystoneclient/access.py b/keystoneclient/access.py
index 1f2affa..2dda12a 100644
--- a/keystoneclient/access.py
+++ b/keystoneclient/access.py
@@ -83,7 +83,7 @@ class AccessInfo(dict):
def will_expire_soon(self, stale_duration=None):
"""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
@@ -100,7 +100,7 @@ class AccessInfo(dict):
"""Determines if processing v2 or v3 token given a successful
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()
diff --git a/keystoneclient/auth/identity/base.py b/keystoneclient/auth/identity/base.py
index 10a9fe8..a58de2a 100644
--- a/keystoneclient/auth/identity/base.py
+++ b/keystoneclient/auth/identity/base.py
@@ -243,7 +243,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin):
:raises: DiscoveryFailure if for some reason the lookup fails.
: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
# so that they maintain sharing between auth plugins. Create a cache on
diff --git a/keystoneclient/contrib/auth/v3/saml2.py b/keystoneclient/contrib/auth/v3/saml2.py
index c9eedac..4ff0ef7 100644
--- a/keystoneclient/contrib/auth/v3/saml2.py
+++ b/keystoneclient/contrib/auth/v3/saml2.py
@@ -518,7 +518,7 @@ class ADFSUnscopedToken(_BaseSAMLPlugin):
and let Python raise the AttributeError.
: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
"""
diff --git a/keystoneclient/middleware/auth_token.py b/keystoneclient/middleware/auth_token.py
index 64a4a98..bb1e041 100644
--- a/keystoneclient/middleware/auth_token.py
+++ b/keystoneclient/middleware/auth_token.py
@@ -1110,7 +1110,7 @@ class AuthProtocol(object):
:param retry: flag that forces the middleware to retry
user authentication when an indeterminate
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 ServiceError: if unable to authenticate token
diff --git a/keystoneclient/openstack/common/timeutils.py b/keystoneclient/openstack/common/timeutils.py
index c48da95..49d8287 100644
--- a/keystoneclient/openstack/common/timeutils.py
+++ b/keystoneclient/openstack/common/timeutils.py
@@ -204,7 +204,7 @@ def is_soon(dt, window):
:param dt: the time
: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))
return normalize_time(dt) <= soon
diff --git a/keystoneclient/tests/generic/test_shell.py b/keystoneclient/tests/generic/test_shell.py
index e30b056..194c5b2 100644
--- a/keystoneclient/tests/generic/test_shell.py
+++ b/keystoneclient/tests/generic/test_shell.py
@@ -48,7 +48,7 @@ class DoDiscoverTest(utils.TestCase):
def _execute_discover(self):
"""Call do_discover function and capture output
- :return: captured output is returned
+ :returns: captured output is returned
"""
with mock.patch('sys.stdout',
new_callable=moves.StringIO) as mock_stdout: