Removing tox ignore D400.

Currently tox ignores D400 (D400: First line should end with a period).
This change removes D400 ignore.
All pep8 violatios are fixed.

Change-Id: I9190a15a36c90d3c60a9c520cb53d5f182b0c4e9
This commit is contained in:
Navid Pustchi 2016-04-18 20:37:46 +00:00
parent 7d0cb04e6d
commit 2e0c0030a9
17 changed files with 31 additions and 30 deletions

View File

@ -116,7 +116,7 @@ class AccessInfo(object):
@property
def expires(self):
"""Return the token expiration (as datetime object)
"""Return the token expiration (as datetime object).
:returns: datetime
"""
@ -124,7 +124,7 @@ class AccessInfo(object):
@property
def issued(self):
"""Return the token issue time (as datetime object)
"""Return the token issue time (as datetime object).
:returns: datetime
"""

View File

@ -189,7 +189,7 @@ class Adapter(object):
@classmethod
def register_argparse_arguments(cls, parser, service_type=None):
"""Attach arguments to a given argparse Parser for Adapters
"""Attach arguments to a given argparse Parser for Adapters.
:param parser: The argparse parser to attach options to.
:type parser: argparse.ArgumentParser
@ -238,7 +238,7 @@ class Adapter(object):
@classmethod
def register_service_argparse_arguments(cls, parser, service_type):
"""Attach arguments to a given argparse Parser for Adapters
"""Attach arguments to a given argparse Parser for Adapters.
:param parser: The argparse parser to attach options to.
:type parser: argparse.ArgumentParser

View File

@ -17,7 +17,7 @@
# under the License.
"""
HTTP Exceptions used by keystoneauth1
HTTP Exceptions used by keystoneauth1.
"""
import inspect

View File

@ -16,7 +16,8 @@ __all__ = ('ServiceProviderNotFound',)
class ServiceProviderNotFound(base.ClientException):
"""A Service Provider cannot be found"""
"""A Service Provider cannot be found.
"""
def __init__(self, sp_id):
self.sp_id = sp_id

View File

@ -35,7 +35,7 @@ class BaseSAMLPlugin(v3.FederationBaseAuth):
identity_provider, identity_provider_url,
username, password, protocol,
**kwargs):
"""Class constructor accepting following parameters:
"""Class constructor accepting following parameters.
:param auth_url: URL of the Identity Service
:type auth_url: string
@ -46,8 +46,9 @@ class BaseSAMLPlugin(v3.FederationBaseAuth):
obtain unscoped OpenStack token.
:type identity_provider: string
:param identity_provider_url: An Identity Provider URL, where the SAML2
authn request will be sent.
:param identity_provider_url: An Identity Provider URL, where the
SAML2 auhentication request will be
sent.
:type identity_provider_url: string
:param username: User's login

View File

@ -11,8 +11,7 @@
# under the License.
"""
The generators in this directory produce keystone compliant structures for use
in testing.
Produce keystone compliant structures for use in testing.
They are 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

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
"""A fixture to wrap the session constructor for use with Betamax"""
"""A fixture to wrap the session constructor for use with Betamax."""
from functools import partial

View File

@ -86,7 +86,7 @@ class Auth(base.BaseIdentityPlugin):
@property
def has_scope_parameters(self):
"""Return true if parameters can be used to create a scoped token"""
"""Return true if parameters can be used to create a scoped token."""
return self.tenant_id or self.tenant_name or self.trust_id

View File

@ -77,7 +77,7 @@ class BaseAuth(base.BaseIdentityPlugin):
@property
def has_scope_parameters(self):
"""Return true if parameters can be used to create a scoped token"""
"""Return true if parameters can be used to create a scoped token."""
return (self.domain_id or self.domain_name or
self.project_id or self.project_name or
self.trust_id)

View File

@ -50,7 +50,7 @@ class Keystone2Keystone(federation._Rescoped):
@classmethod
def _remote_auth_url(cls, auth_url):
"""Return auth_url of the remote Keystone Service Provider
"""Return auth_url of the remote Keystone Service Provider.
Remote cloud's auth_url is an endpoint for getting federated unscoped
token, typically that would be

View File

@ -20,7 +20,7 @@ __all__ = ('OidcAuthorizationCode',
class _OidcBase(federation.FederationBaseAuth):
"""Base class for different OpenID Connect based flows
"""Base class for different OpenID Connect based flows.
The OpenID Connect specification can be found at::
``http://openid.net/specs/openid-connect-core-1_0.html``
@ -29,7 +29,7 @@ class _OidcBase(federation.FederationBaseAuth):
def __init__(self, auth_url, identity_provider, protocol,
client_id, client_secret, access_token_endpoint,
grant_type, access_token_type, **kwargs):
"""The OpenID Connect plugin expects the following:
"""The OpenID Connect plugin expects the following.
:param auth_url: URL of the Identity Service
:type auth_url: string
@ -130,14 +130,15 @@ class _OidcBase(federation.FederationBaseAuth):
class OidcPassword(_OidcBase):
"""Implementation for OpenID Connect Resource Owner Password Credential"""
"""Implementation for OpenID Connect Resource Owner Password Credential.
"""
@positional(4)
def __init__(self, auth_url, identity_provider, protocol,
client_id, client_secret, access_token_endpoint,
grant_type='password', access_token_type='access_token',
username=None, password=None, scope='profile'):
"""The OpenID Password plugin expects the following:
"""The OpenID Password plugin expects the following.
:param username: Username used to authenticate
:type username: string
@ -201,7 +202,7 @@ class OidcPassword(_OidcBase):
class OidcAuthorizationCode(_OidcBase):
"""Implementation for OpenID Connect Authorization Code"""
"""Implementation for OpenID Connect Authorization Code."""
@positional(4)
def __init__(self, auth_url, identity_provider, protocol,
@ -209,7 +210,7 @@ class OidcAuthorizationCode(_OidcBase):
grant_type='authorization_code',
access_token_type='access_token',
redirect_uri=None, code=None):
"""The OpenID Authorization Code plugin expects the following:
"""The OpenID Authorization Code plugin expects the following.
:param redirect_uri: OpenID Connect Client Redirect URL
:type redirect_uri: string

View File

@ -125,7 +125,7 @@ class BaseLoader(object):
return self.plugin_class(**kwargs)
def load_from_options_getter(self, getter, **kwargs):
"""Load a plugin from a getter function that returns appropriate values
"""Load a plugin from getter function that returns 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

View File

@ -176,7 +176,7 @@ class BaseAuthPlugin(object):
return None
def get_sp_auth_url(self, session, sp_id, **kwargs):
"""Return auth_url from the Service Provider object
"""Return auth_url from the Service Provider object.
This url is used for obtaining unscoped federated token from remote
cloud.
@ -191,7 +191,7 @@ class BaseAuthPlugin(object):
return None
def get_sp_url(self, session, sp_id, **kwargs):
"""Return sp_url from the Service Provider object
"""Return sp_url from the Service Provider object.
This url is used for passing SAML2 assertion to the remote cloud.

View File

@ -72,7 +72,7 @@ class _JSONEncoder(json.JSONEncoder):
class _StringFormatter(object):
"""A String formatter that fetches values on demand"""
"""A String formatter that fetches values on demand."""
def __init__(self, session, auth):
self.session = session

View File

@ -140,7 +140,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.
"""
@ -175,7 +175,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

View File

@ -99,7 +99,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.
"""

View File

@ -43,8 +43,7 @@ commands = oslo_debug_helper -t keystoneauth1/tests {posargs}
# 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 = H405,D100,D101,D102,D103,D104,D105,D200,D203,D204,D205,D208,D211,D301,D400
ignore = H405,D100,D101,D102,D103,D104,D105,D200,D203,D204,D205,D208,D211,D301
show-source = True
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*