Merge "Fix some inconsistency in docstrings"

This commit is contained in:
Jenkins 2016-01-04 08:23:30 +00:00 committed by Gerrit Code Review
commit 7b62b36960
8 changed files with 22 additions and 24 deletions

View File

@ -584,7 +584,7 @@ class V3Controller(wsgi.Application):
:param filter: the filter in question :param filter: the filter in question
:param ref: the dict to check :param ref: the dict to check
:returns True if there is a match :returns: True if there is a match
""" """
comparator = filter['comparator'] comparator = filter['comparator']

View File

@ -113,7 +113,6 @@ class KeyValueStore(object):
this instantiation this instantiation
:param region_config_args: key-word args passed to the dogpile.cache :param region_config_args: key-word args passed to the dogpile.cache
backend for configuration backend for configuration
:return:
""" """
if self.is_configured: if self.is_configured:
# NOTE(morganfainberg): It is a bad idea to reconfigure a backend, # NOTE(morganfainberg): It is a bad idea to reconfigure a backend,

View File

@ -342,7 +342,7 @@ def _limit(query, hints):
:param query: query to apply filters to :param query: query to apply filters to
:param hints: contains the list of filters and limit details. :param hints: contains the list of filters and limit details.
:returns updated query :returns: updated query
""" """
# NOTE(henry-nash): If we were to implement pagination, then we # NOTE(henry-nash): If we were to implement pagination, then we

View File

@ -208,7 +208,7 @@ def auth_str_equal(provided, known):
:params provided: the first string :params provided: the first string
:params known: the second string :params known: the second string
:return: True if the strings are equal. :returns: True if the strings are equal.
This function takes two strings and compares them. It is intended to be This function takes two strings and compares them. It is intended to be
used when doing a comparison for authentication purposes to help guard used when doing a comparison for authentication purposes to help guard
@ -273,7 +273,7 @@ def get_unix_user(user=None):
:param object user: string, int or None specifying the user to :param object user: string, int or None specifying the user to
lookup. lookup.
:return: tuple of (uid, name) :returns: tuple of (uid, name)
""" """
if isinstance(user, six.string_types): if isinstance(user, six.string_types):
@ -329,7 +329,7 @@ def get_unix_group(group=None):
:param object group: string, int or None specifying the group to :param object group: string, int or None specifying the group to
lookup. lookup.
:return: tuple of (gid, name) :returns: tuple of (gid, name)
""" """
if isinstance(group, six.string_types): if isinstance(group, six.string_types):

View File

@ -247,7 +247,7 @@ class FederationDriverV8(object):
def list_mappings(self): def list_mappings(self):
"""List all mappings. """List all mappings.
returns: list of mappings :returns: list of mappings
""" """
raise exception.NotImplemented() # pragma: no cover raise exception.NotImplemented() # pragma: no cover
@ -313,7 +313,7 @@ class FederationDriverV8(object):
def list_sps(self): def list_sps(self):
"""List all service providers. """List all service providers.
:returns List of sp_ref objects :returns: List of sp_ref objects
:rtype: list of dicts :rtype: list of dicts
""" """

View File

@ -68,7 +68,7 @@ class SAMLGenerator(object):
:param expires_in: Sets how long the assertion is valid for, in seconds :param expires_in: Sets how long the assertion is valid for, in seconds
:type expires_in: int :type expires_in: int
:return: XML <Response> object :returns: XML <Response> object
""" """
expiration_time = self._determine_expiration_time(expires_in) expiration_time = self._determine_expiration_time(expires_in)
@ -105,7 +105,7 @@ class SAMLGenerator(object):
Value="urn:oasis:names:tc:SAML:2.0:status:Success" /> Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</ns0:Status> </ns0:Status>
:return: XML <Status> object :returns: XML <Status> object
""" """
status = samlp.Status() status = samlp.Status()
@ -123,7 +123,7 @@ class SAMLGenerator(object):
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"> Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
https://acme.com/FIM/sps/openstack/saml20</ns0:Issuer> https://acme.com/FIM/sps/openstack/saml20</ns0:Issuer>
:return: XML <Issuer> object :returns: XML <Issuer> object
""" """
issuer = saml.Issuer() issuer = saml.Issuer()
@ -145,7 +145,7 @@ class SAMLGenerator(object):
</ns0:SubjectConfirmation> </ns0:SubjectConfirmation>
</ns0:Subject> </ns0:Subject>
:return: XML <Subject> object :returns: XML <Subject> object
""" """
name_id = saml.NameID() name_id = saml.NameID()
@ -190,7 +190,7 @@ class SAMLGenerator(object):
</ns0:Attribute> </ns0:Attribute>
</ns0:AttributeStatement> </ns0:AttributeStatement>
:return: XML <AttributeStatement> object :returns: XML <AttributeStatement> object
""" """
def _build_attribute(attribute_name, attribute_values): def _build_attribute(attribute_name, attribute_values):
@ -236,7 +236,7 @@ class SAMLGenerator(object):
</ns0:AuthnContext> </ns0:AuthnContext>
</ns0:AuthnStatement> </ns0:AuthnStatement>
:return: XML <AuthnStatement> object :returns: XML <AuthnStatement> object
""" """
authn_statement = saml.AuthnStatement() authn_statement = saml.AuthnStatement()
@ -272,7 +272,7 @@ class SAMLGenerator(object):
<ns0:AttributeStatement> ... </ns0:AttributeStatement> <ns0:AttributeStatement> ... </ns0:AttributeStatement>
</ns0:Assertion> </ns0:Assertion>
:return: XML <Assertion> object :returns: XML <Assertion> object
""" """
assertion = saml.Assertion() assertion = saml.Assertion()
@ -299,7 +299,7 @@ class SAMLGenerator(object):
<ns0:Status> ... </ns0:Status> <ns0:Status> ... </ns0:Status>
</ns0:Response> </ns0:Response>
:return: XML <Response> object :returns: XML <Response> object
""" """
response = samlp.Response() response = samlp.Response()
@ -342,7 +342,7 @@ class SAMLGenerator(object):
</KeyInfo> </KeyInfo>
</Signature> </Signature>
:return: XML <Signature> object :returns: XML <Signature> object
""" """
canonicalization_method = xmldsig.CanonicalizationMethod() canonicalization_method = xmldsig.CanonicalizationMethod()
@ -397,7 +397,7 @@ def _sign_assertion(assertion):
* xmlsec_binary * xmlsec_binary
* private key file path * private key file path
* public key file path * public key file path
:return: XML <Assertion> object :returns: XML <Assertion> object
""" """
xmlsec_binary = CONF.saml.xmlsec1_binary xmlsec_binary = CONF.saml.xmlsec1_binary
@ -462,10 +462,9 @@ class MetadataGenerator(object):
Generate and format metadata into XML that can be exposed and Generate and format metadata into XML that can be exposed and
consumed by a federated Service Provider. consumed by a federated Service Provider.
:return: XML <EntityDescriptor> object. :returns: XML <EntityDescriptor> object.
:raises keystone.exception.ValidationError: If the required :raises keystone.exception.ValidationError: If the required
config options aren't set. config options aren't set.
""" """
self._ensure_required_values_present() self._ensure_required_values_present()
entity_descriptor = self._create_entity_descriptor() entity_descriptor = self._create_entity_descriptor()

View File

@ -660,7 +660,7 @@ class TestCase(BaseTestCase):
This is useful to load managers initialized by extensions. No extra This is useful to load managers initialized by extensions. No extra
backends are loaded by default. backends are loaded by default.
:return: dict of name -> manager :returns: dict of name -> manager
""" """
return {} return {}

View File

@ -61,10 +61,10 @@ def _matches(event, token_values):
value for the attribute, and it does not match the token, no match value for the attribute, and it does not match the token, no match
is possible, so skip the remaining checks. is possible, so skip the remaining checks.
:param event one revocation event to match :param event: one revocation event to match
:param token_values dictionary with set of values taken from the :param token_values: dictionary with set of values taken from the
token token
:returns if the token matches the revocation event, indicating the :returns: if the token matches the revocation event, indicating the
token has been revoked token has been revoked
""" """
# The token has three attributes that can match the user_id # The token has three attributes that can match the user_id