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

View File

@ -189,7 +189,7 @@ class Adapter(object):
@classmethod @classmethod
def register_argparse_arguments(cls, parser, service_type=None): 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. :param parser: The argparse parser to attach options to.
:type parser: argparse.ArgumentParser :type parser: argparse.ArgumentParser
@ -238,7 +238,7 @@ class Adapter(object):
@classmethod @classmethod
def register_service_argparse_arguments(cls, parser, service_type): 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. :param parser: The argparse parser to attach options to.
:type parser: argparse.ArgumentParser :type parser: argparse.ArgumentParser

View File

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

View File

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

View File

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

View File

@ -11,8 +11,7 @@
# under the License. # under the License.
""" """
The generators in this directory produce keystone compliant structures for use Produce keystone compliant structures for use in testing.
in testing.
They are part of the public API because they may be relied upon to generate 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 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 # License for the specific language governing permissions and limitations
# under the License. # 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 from functools import partial

View File

@ -86,7 +86,7 @@ class Auth(base.BaseIdentityPlugin):
@property @property
def has_scope_parameters(self): 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 return self.tenant_id or self.tenant_name or self.trust_id

View File

@ -77,7 +77,7 @@ class BaseAuth(base.BaseIdentityPlugin):
@property @property
def has_scope_parameters(self): 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 return (self.domain_id or self.domain_name or
self.project_id or self.project_name or self.project_id or self.project_name or
self.trust_id) self.trust_id)

View File

@ -50,7 +50,7 @@ class Keystone2Keystone(federation._Rescoped):
@classmethod @classmethod
def _remote_auth_url(cls, auth_url): 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 Remote cloud's auth_url is an endpoint for getting federated unscoped
token, typically that would be token, typically that would be

View File

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

View File

@ -125,7 +125,7 @@ class BaseLoader(object):
return self.plugin_class(**kwargs) return self.plugin_class(**kwargs)
def load_from_options_getter(self, getter, **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 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 specify a custom loader function that will be queried for the option

View File

@ -176,7 +176,7 @@ class BaseAuthPlugin(object):
return None return None
def get_sp_auth_url(self, session, sp_id, **kwargs): 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 This url is used for obtaining unscoped federated token from remote
cloud. cloud.
@ -191,7 +191,7 @@ class BaseAuthPlugin(object):
return None return None
def get_sp_url(self, session, sp_id, **kwargs): 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. 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): class _StringFormatter(object):
"""A String formatter that fetches values on demand""" """A String formatter that fetches values on demand."""
def __init__(self, session, auth): def __init__(self, session, auth):
self.session = session self.session = session

View File

@ -140,7 +140,7 @@ class SessionTests(utils.TestCase):
session.get, self.TEST_URL) session.get, self.TEST_URL)
def test_session_debug_output(self): 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. in order to redact secure headers while debug is true.
""" """
@ -175,7 +175,7 @@ class SessionTests(utils.TestCase):
self.assertNotIn(v, self.logger.output) self.assertNotIn(v, self.logger.output)
def test_logs_failed_output(self): 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() session = client_session.Session()
body = uuid.uuid4().hex body = uuid.uuid4().hex

View File

@ -99,7 +99,7 @@ class TestCase(testtools.TestCase):
self.assertIn(v, qs[k]) self.assertIn(v, qs[k])
def assertRequestHeaderEqual(self, name, val): 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. 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 # D208: Docstring is over-indented
# D211: No blank lines allowed before class docstring # D211: No blank lines allowed before class docstring
# D301: Use r”“” if any backslashes in a 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
ignore = H405,D100,D101,D102,D103,D104,D105,D200,D203,D204,D205,D208,D211,D301,D400
show-source = True show-source = True
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common* exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*