Fix D400 PEP257 violation.
Currently tox ignores D400. D400: First line should end with a period. This change removes it and make keystoneclient docstrings compliant with it. Change-Id: I29ecb4c58bb03c0b9a3be0b7a74d18fb06a350f2
This commit is contained in:
		@@ -153,7 +153,7 @@ class AccessInfo(dict):
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def expires(self):
 | 
			
		||||
        """Return the token expiration (as datetime object)
 | 
			
		||||
        """Return the token expiration (as datetime object).
 | 
			
		||||
 | 
			
		||||
        :returns: datetime
 | 
			
		||||
        """
 | 
			
		||||
@@ -161,7 +161,7 @@ class AccessInfo(dict):
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def issued(self):
 | 
			
		||||
        """Return the token issue time (as datetime object)
 | 
			
		||||
        """Return the token issue time (as datetime object).
 | 
			
		||||
 | 
			
		||||
        :returns: datetime
 | 
			
		||||
        """
 | 
			
		||||
 
 | 
			
		||||
@@ -351,7 +351,7 @@ class BaseAuthPlugin(object):
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def load_from_options_getter(cls, getter, **kwargs):
 | 
			
		||||
        """Load a plugin from a getter function that returns appropriate values
 | 
			
		||||
        """Load a plugin from a getter function returning appropriate values.
 | 
			
		||||
 | 
			
		||||
        To handle cases other than the provided CONF and CLI loading you can
 | 
			
		||||
        specify a custom loader function that will be queried for the option
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,9 @@ class FederatedBaseAuth(base.BaseAuth):
 | 
			
		||||
    rescoping_plugin = token.Token
 | 
			
		||||
 | 
			
		||||
    def __init__(self, auth_url, identity_provider, protocol, **kwargs):
 | 
			
		||||
        """Class constructor accepting following parameters:
 | 
			
		||||
        """Class constructor for federated authentication plugins.
 | 
			
		||||
 | 
			
		||||
        Accepting following parameters:
 | 
			
		||||
 | 
			
		||||
        :param auth_url: URL of the Identity Service
 | 
			
		||||
        :type auth_url: string
 | 
			
		||||
 
 | 
			
		||||
@@ -202,7 +202,7 @@ def cms_verify(formatted, signing_cert_file_name, ca_file_name,
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def is_pkiz(token_text):
 | 
			
		||||
    """Determine if a token a cmsz token
 | 
			
		||||
    """Determine if a token is PKIZ.
 | 
			
		||||
 | 
			
		||||
    Checks if the string has the prefix that indicates it is a
 | 
			
		||||
    Crypto Message Syntax, Z compressed token.
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,9 @@ class OidcPassword(federated.FederatedBaseAuth):
 | 
			
		||||
                 username, password, client_id, client_secret,
 | 
			
		||||
                 access_token_endpoint, scope='profile',
 | 
			
		||||
                 grant_type='password'):
 | 
			
		||||
        """The OpenID Connect plugin expects the following:
 | 
			
		||||
        """The OpenID Connect plugin.
 | 
			
		||||
 | 
			
		||||
        It expects the following:
 | 
			
		||||
 | 
			
		||||
        :param auth_url: URL of the Identity Service
 | 
			
		||||
        :type auth_url: string
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,7 @@ def attr_keys(event):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class RevokeTree(object):
 | 
			
		||||
    """Fast Revocation Checking Tree Structure
 | 
			
		||||
    """Fast Revocation Checking Tree Structure.
 | 
			
		||||
 | 
			
		||||
    The Tree is an index to quickly match tokens against events.
 | 
			
		||||
    Each node is a hashtable of key=value combinations from revocation events.
 | 
			
		||||
@@ -127,7 +127,7 @@ class RevokeTree(object):
 | 
			
		||||
        return event
 | 
			
		||||
 | 
			
		||||
    def remove_event(self, event):
 | 
			
		||||
        """Update the tree based on the removal of a Revocation Event
 | 
			
		||||
        """Update the tree based on the removal of a Revocation Event.
 | 
			
		||||
 | 
			
		||||
        Removes empty nodes from the tree from the leaf back to the root.
 | 
			
		||||
 | 
			
		||||
@@ -158,7 +158,7 @@ class RevokeTree(object):
 | 
			
		||||
        return map(self.add_event, revoke_events or [])
 | 
			
		||||
 | 
			
		||||
    def is_revoked(self, token_data):
 | 
			
		||||
        """Check if a token matches the revocation event
 | 
			
		||||
        """Check if a token is revoked.
 | 
			
		||||
 | 
			
		||||
        Compare the values for each level of the tree with the values from
 | 
			
		||||
        the token, accounting for attributes that have alternative
 | 
			
		||||
 
 | 
			
		||||
@@ -11,9 +11,10 @@
 | 
			
		||||
# under the License.
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
The generators in this directory produce keystone compliant structures for use
 | 
			
		||||
in testing.
 | 
			
		||||
Produce keystone compliant structures for testing.
 | 
			
		||||
 | 
			
		||||
The generators in this directory produce keystone compliant structures for
 | 
			
		||||
use in testing.
 | 
			
		||||
They should be considered part of the public API because they may be relied
 | 
			
		||||
upon to generate test tokens for other clients. However they should never be
 | 
			
		||||
imported into the main client (keystoneclient or other). Because of this there
 | 
			
		||||
 
 | 
			
		||||
@@ -147,7 +147,7 @@ class _KeystoneAdapter(adapter.LegacyJsonAdapter):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
 | 
			
		||||
    """HTTP client
 | 
			
		||||
    """HTTP client.
 | 
			
		||||
 | 
			
		||||
    .. warning::
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ OPENSTACK_CLOUDS = ('functional_admin', 'devstack-admin', 'envvars')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_client(version):
 | 
			
		||||
    """Create a keystoneclient instance to run functional tests
 | 
			
		||||
    """Create a keystoneclient instance to run functional tests.
 | 
			
		||||
 | 
			
		||||
        The client is instantiated via os-client-config either based on a
 | 
			
		||||
        clouds.yaml config file or from the environment variables.
 | 
			
		||||
 
 | 
			
		||||
@@ -144,7 +144,7 @@ class SessionTests(utils.TestCase):
 | 
			
		||||
                          session.get, self.TEST_URL)
 | 
			
		||||
 | 
			
		||||
    def test_session_debug_output(self):
 | 
			
		||||
        """Test request and response headers in debug logs
 | 
			
		||||
        """Test request and response headers in debug logs.
 | 
			
		||||
 | 
			
		||||
        in order to redact secure headers while debug is true.
 | 
			
		||||
        """
 | 
			
		||||
@@ -179,7 +179,7 @@ class SessionTests(utils.TestCase):
 | 
			
		||||
            self.assertNotIn(v, self.logger.output)
 | 
			
		||||
 | 
			
		||||
    def test_logs_failed_output(self):
 | 
			
		||||
        """Test that output is logged even for failed requests"""
 | 
			
		||||
        """Test that output is logged even for failed requests."""
 | 
			
		||||
 | 
			
		||||
        session = client_session.Session()
 | 
			
		||||
        body = uuid.uuid4().hex
 | 
			
		||||
 
 | 
			
		||||
@@ -102,7 +102,7 @@ class TestCase(testtools.TestCase):
 | 
			
		||||
            self.assertIn(v, qs[k])
 | 
			
		||||
 | 
			
		||||
    def assertRequestHeaderEqual(self, name, val):
 | 
			
		||||
        """Verify that the last request made contains a header and its value
 | 
			
		||||
        """Verify that the last request made contains a header and its value.
 | 
			
		||||
 | 
			
		||||
        The request must have already been made.
 | 
			
		||||
        """
 | 
			
		||||
 
 | 
			
		||||
@@ -166,7 +166,7 @@ class ProtocolTests(utils.ClientTestCase, utils.CrudTests):
 | 
			
		||||
        self.assertEqual('/'.join([base_url, self.collection_key]), url)
 | 
			
		||||
 | 
			
		||||
    def test_build_url_w_idp_id(self):
 | 
			
		||||
        """Test whether kwargs ``base_url`` discards object's base_url
 | 
			
		||||
        """Test whether kwargs ``base_url`` discards object's base_url.
 | 
			
		||||
 | 
			
		||||
        This test shows, that when ``base_url`` is specified in the
 | 
			
		||||
        dict_args_in_out dictionary,  values like ``identity_provider_id``
 | 
			
		||||
@@ -299,7 +299,7 @@ class ProtocolTests(utils.ClientTestCase, utils.CrudTests):
 | 
			
		||||
        self.assertQueryStringContains(**filter_kwargs)
 | 
			
		||||
 | 
			
		||||
    def test_update(self):
 | 
			
		||||
        """Test updating federation protocol
 | 
			
		||||
        """Test updating federation protocol.
 | 
			
		||||
 | 
			
		||||
        URL to be tested: PATCH /OS-FEDERATION/identity_providers/
 | 
			
		||||
        $identity_provider/protocols/$protocol
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,7 @@ def hash_signed_token(signed_text, mode='md5'):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def prompt_user_password():
 | 
			
		||||
    """Prompt user for a password
 | 
			
		||||
    """Prompt user for a password.
 | 
			
		||||
 | 
			
		||||
    Prompt for a password if stdin is a tty.
 | 
			
		||||
    """
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ from keystoneclient import exceptions
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Tenant(base.Resource):
 | 
			
		||||
    """Represents a Keystone tenant
 | 
			
		||||
    """Represents a Keystone tenant.
 | 
			
		||||
 | 
			
		||||
    Attributes:
 | 
			
		||||
        * id: a uuid that identifies the tenant
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ from keystoneclient import base
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class IdentityProvider(base.Resource):
 | 
			
		||||
    """Object representing Identity Provider container
 | 
			
		||||
    """Object representing Identity Provider container.
 | 
			
		||||
 | 
			
		||||
    Attributes:
 | 
			
		||||
        * id: user-defined unique string identifying Identity Provider.
 | 
			
		||||
@@ -53,7 +53,7 @@ class IdentityProviderManager(base.CrudManager):
 | 
			
		||||
                                       **kwargs)
 | 
			
		||||
 | 
			
		||||
    def get(self, identity_provider):
 | 
			
		||||
        """Fetch Identity Provider object
 | 
			
		||||
        """Fetch Identity Provider object.
 | 
			
		||||
 | 
			
		||||
        Utilize Keystone URI:
 | 
			
		||||
        GET /OS-FEDERATION/identity_providers/$identity_provider
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ from keystoneclient import base
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Mapping(base.Resource):
 | 
			
		||||
    """An object representing mapping container
 | 
			
		||||
    """An object representing mapping container.
 | 
			
		||||
 | 
			
		||||
    Attributes:
 | 
			
		||||
        * id: user defined unique string identifying mapping.
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@ from keystoneclient import base
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ServiceProvider(base.Resource):
 | 
			
		||||
    """Object representing Service Provider container
 | 
			
		||||
    """Object representing Service Provider container.
 | 
			
		||||
 | 
			
		||||
    Attributes:
 | 
			
		||||
        * id: user-defined unique string identifying Service Provider.
 | 
			
		||||
@@ -55,7 +55,7 @@ class ServiceProviderManager(base.CrudManager):
 | 
			
		||||
                                       **kwargs)
 | 
			
		||||
 | 
			
		||||
    def get(self, service_provider):
 | 
			
		||||
        """Fetch Service Provider object
 | 
			
		||||
        """Fetch Service Provider object.
 | 
			
		||||
 | 
			
		||||
        Utilize Keystone URI:
 | 
			
		||||
        ``GET /OS-FEDERATION/service_providers/{id}``
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ OAUTH_PATH = '/OS-OAUTH1'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_oauth_token_from_body(body):
 | 
			
		||||
    """Parse the URL response body to retrieve the oauth token key and secret
 | 
			
		||||
    """Parse the URL response body to retrieve the oauth token key and secret.
 | 
			
		||||
 | 
			
		||||
    The response body will look like:
 | 
			
		||||
    'oauth_token=12345&oauth_token_secret=67890' with
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,7 @@ class CredentialManager(base.CrudManager):
 | 
			
		||||
                           removal_version='2.0.0')
 | 
			
		||||
    @positional(1, enforcement=positional.WARN)
 | 
			
		||||
    def create(self, user, type, blob=None, data=None, project=None, **kwargs):
 | 
			
		||||
        """Create a credential
 | 
			
		||||
        """Create a credential.
 | 
			
		||||
 | 
			
		||||
        :param user: User
 | 
			
		||||
        :type user: :class:`keystoneclient.v3.users.User` or str
 | 
			
		||||
@@ -80,7 +80,7 @@ class CredentialManager(base.CrudManager):
 | 
			
		||||
            **kwargs)
 | 
			
		||||
 | 
			
		||||
    def get(self, credential):
 | 
			
		||||
        """Get a credential
 | 
			
		||||
        """Get a credential.
 | 
			
		||||
 | 
			
		||||
        :param credential: Credential
 | 
			
		||||
        :type credential: :class:`Credential` or str
 | 
			
		||||
@@ -102,7 +102,7 @@ class CredentialManager(base.CrudManager):
 | 
			
		||||
    @positional(2, enforcement=positional.WARN)
 | 
			
		||||
    def update(self, credential, user, type=None, blob=None, data=None,
 | 
			
		||||
               project=None, **kwargs):
 | 
			
		||||
        """Update a credential
 | 
			
		||||
        """Update a credential.
 | 
			
		||||
 | 
			
		||||
        :param credential: Credential to update
 | 
			
		||||
        :type credential: :class:`Credential` or str
 | 
			
		||||
@@ -128,7 +128,7 @@ class CredentialManager(base.CrudManager):
 | 
			
		||||
            **kwargs)
 | 
			
		||||
 | 
			
		||||
    def delete(self, credential):
 | 
			
		||||
        """Delete a credential
 | 
			
		||||
        """Delete a credential.
 | 
			
		||||
 | 
			
		||||
        :param credential: Credential
 | 
			
		||||
        :type credential: :class:`Credential` or str
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ class Role(base.Resource):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class InferenceRule(base.Resource):
 | 
			
		||||
    """Represents an Rule that states one ROle implies another
 | 
			
		||||
    """Represents an Rule that states one ROle implies another.
 | 
			
		||||
 | 
			
		||||
    Attributes:
 | 
			
		||||
        * prior_role: this role implies the other
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								tox.ini
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								tox.ini
									
									
									
									
									
								
							@@ -55,8 +55,7 @@ passenv = OS_*
 | 
			
		||||
# D208: Docstring is over-indented
 | 
			
		||||
# D211: No blank lines allowed before class docstring
 | 
			
		||||
# D301: Use r”“” if any backslashes in a docstring
 | 
			
		||||
# D400: First line should end with a period.
 | 
			
		||||
ignore = D100,D101,D102,D103,D104,D105,D200,D202,D203,D204,D205,D207,D208,D211,D301,D400
 | 
			
		||||
ignore = D100,D101,D102,D103,D104,D105,D200,D202,D203,D204,D205,D207,D208,D211,D301
 | 
			
		||||
show-source = True
 | 
			
		||||
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user