Fixing D204, D205, and D207 PEP257 violation.

Currently tox ignores D204, D205, and D207.
D204: 1 blank required after class docstring.
D205: Blank line required between one-line summary and description.
D207: Docstring is under-indented.
This change removes  D204, D205, and D207 ignores in tox and fix violations.

Change-Id: Id20d216fbd7647d468859b960088aac61c582d9b
This commit is contained in:
Navid Pustchi 2016-05-03 18:08:31 +00:00
parent e9471bdf4c
commit a9adca02db
34 changed files with 63 additions and 6 deletions

View File

@ -86,6 +86,7 @@ class Manager(object):
:param client: instance of BaseClient descendant for HTTP requests :param client: instance of BaseClient descendant for HTTP requests
""" """
resource_class = None resource_class = None
def __init__(self, client): def __init__(self, client):
@ -293,6 +294,7 @@ class CrudManager(Manager):
refer to an individual member of the collection. refer to an individual member of the collection.
""" """
collection_key = None collection_key = None
key = None key = None
base_url = None base_url = None

View File

@ -52,21 +52,25 @@ An alias of :py:exc:`keystoneauth1.exceptions.auth.AuthorizationFailure`
class ValidationError(ClientException): class ValidationError(ClientException):
"""Error in validation on API client side.""" """Error in validation on API client side."""
pass pass
class UnsupportedVersion(ClientException): class UnsupportedVersion(ClientException):
"""User is trying to use an unsupported version of the API.""" """User is trying to use an unsupported version of the API."""
pass pass
class CommandError(ClientException): class CommandError(ClientException):
"""Error in CLI tool.""" """Error in CLI tool."""
pass pass
class AuthPluginOptionsMissing(AuthorizationFailure): class AuthPluginOptionsMissing(AuthorizationFailure):
"""Auth plugin misses some options.""" """Auth plugin misses some options."""
def __init__(self, opt_names): def __init__(self, opt_names):
super(AuthPluginOptionsMissing, self).__init__( super(AuthPluginOptionsMissing, self).__init__(
_("Authentication failed. Missing options: %s") % _("Authentication failed. Missing options: %s") %
@ -76,6 +80,7 @@ class AuthPluginOptionsMissing(AuthorizationFailure):
class AuthSystemNotFound(AuthorizationFailure): class AuthSystemNotFound(AuthorizationFailure):
"""User has specified an AuthSystem that is not installed.""" """User has specified an AuthSystem that is not installed."""
def __init__(self, auth_system): def __init__(self, auth_system):
super(AuthSystemNotFound, self).__init__( super(AuthSystemNotFound, self).__init__(
_("AuthSystemNotFound: %r") % auth_system) _("AuthSystemNotFound: %r") % auth_system)
@ -84,6 +89,7 @@ class AuthSystemNotFound(AuthorizationFailure):
class NoUniqueMatch(ClientException): class NoUniqueMatch(ClientException):
"""Multiple entities found instead of one.""" """Multiple entities found instead of one."""
pass pass
@ -102,6 +108,7 @@ An alias of :py:exc:`keystoneauth1.exceptions.catalog.EndpointNotFound`
class AmbiguousEndpoints(EndpointException): class AmbiguousEndpoints(EndpointException):
"""Found more than one matching endpoint in Service Catalog.""" """Found more than one matching endpoint in Service Catalog."""
def __init__(self, endpoints=None): def __init__(self, endpoints=None):
super(AmbiguousEndpoints, self).__init__( super(AmbiguousEndpoints, self).__init__(
_("AmbiguousEndpoints: %r") % endpoints) _("AmbiguousEndpoints: %r") % endpoints)
@ -132,6 +139,7 @@ An alias of :py:exc:`keystoneauth1.exceptions.http.HttpServerError`
class HTTPRedirection(HttpError): class HTTPRedirection(HttpError):
"""HTTP Redirection.""" """HTTP Redirection."""
message = _("HTTP Redirection") message = _("HTTP Redirection")
@ -353,6 +361,7 @@ HTTPError = HttpError
class CertificateConfigError(Exception): class CertificateConfigError(Exception):
"""Error reading the certificate.""" """Error reading the certificate."""
def __init__(self, output): def __init__(self, output):
self.output = output self.output = output
msg = _('Unable to load certificate.') msg = _('Unable to load certificate.')
@ -361,6 +370,7 @@ class CertificateConfigError(Exception):
class CMSError(Exception): class CMSError(Exception):
"""Error reading the certificate.""" """Error reading the certificate."""
def __init__(self, output): def __init__(self, output):
self.output = output self.output = output
msg = _('Unable to sign or verify data.') msg = _('Unable to sign or verify data.')

View File

@ -953,6 +953,7 @@ class TCPKeepAliveAdapter(requests.adapters.HTTPAdapter):
disables Nagle's Algorithm. See also: disables Nagle's Algorithm. See also:
http://blogs.msdn.com/b/windowsazurestorage/archive/2010/06/25/nagle-s-algorithm-is-not-friendly-towards-small-requests.aspx http://blogs.msdn.com/b/windowsazurestorage/archive/2010/06/25/nagle-s-algorithm-is-not-friendly-towards-small-requests.aspx
""" """
def init_poolmanager(self, *args, **kwargs): def init_poolmanager(self, *args, **kwargs):
if 'socket_options' not in kwargs: if 'socket_options' not in kwargs:
socket_options = [ socket_options = [

View File

@ -54,6 +54,7 @@ class KeyringTest(utils.TestCase):
setting password, and allows easy password and key retrieval. Also setting password, and allows easy password and key retrieval. Also
records if a password was retrieved. records if a password was retrieved.
""" """
def __init__(self): def __init__(self):
self.key = None self.key = None
self.password = None self.password = None

View File

@ -18,6 +18,7 @@ from keystoneclient import base
class Endpoint(base.Resource): class Endpoint(base.Resource):
"""Represents a Keystone endpoint.""" """Represents a Keystone endpoint."""
def __repr__(self): def __repr__(self):
return "<Endpoint %s>" % self._info return "<Endpoint %s>" % self._info

View File

@ -15,6 +15,7 @@ from keystoneclient import base
class Extension(base.Resource): class Extension(base.Resource):
"""Represents an Identity API extension.""" """Represents an Identity API extension."""
def __repr__(self): def __repr__(self):
return "<Extension %s>" % self._info return "<Extension %s>" % self._info

View File

@ -19,6 +19,7 @@ from keystoneclient import base
class Role(base.Resource): class Role(base.Resource):
"""Represents a Keystone role.""" """Represents a Keystone role."""
def __repr__(self): def __repr__(self):
return "<Role %s>" % self._info return "<Role %s>" % self._info
@ -28,6 +29,7 @@ class Role(base.Resource):
class RoleManager(base.ManagerWithFind): class RoleManager(base.ManagerWithFind):
"""Manager class for manipulating Keystone roles.""" """Manager class for manipulating Keystone roles."""
resource_class = Role resource_class = Role
def get(self, role): def get(self, role):

View File

@ -19,12 +19,14 @@ from keystoneclient import base
class Service(base.Resource): class Service(base.Resource):
"""Represents a Keystone service.""" """Represents a Keystone service."""
def __repr__(self): def __repr__(self):
return "<Service %s>" % self._info return "<Service %s>" % self._info
class ServiceManager(base.ManagerWithFind): class ServiceManager(base.ManagerWithFind):
"""Manager class for manipulating Keystone services.""" """Manager class for manipulating Keystone services."""
resource_class = Service resource_class = Service
def list(self): def list(self):

View File

@ -32,6 +32,7 @@ class Tenant(base.Resource):
* enabled: boolean to indicate if tenant is enabled * enabled: boolean to indicate if tenant is enabled
""" """
def __repr__(self): def __repr__(self):
return "<Tenant %s>" % self._info return "<Tenant %s>" % self._info
@ -72,6 +73,7 @@ class Tenant(base.Resource):
class TenantManager(base.ManagerWithFind): class TenantManager(base.ManagerWithFind):
"""Manager class for manipulating Keystone tenants.""" """Manager class for manipulating Keystone tenants."""
resource_class = Tenant resource_class = Tenant
def __init__(self, client, role_manager, user_manager): def __init__(self, client, role_manager, user_manager):

View File

@ -21,6 +21,7 @@ from keystoneclient import base
class User(base.Resource): class User(base.Resource):
"""Represents a Keystone user.""" """Represents a Keystone user."""
def __repr__(self): def __repr__(self):
return "<User %s>" % self._info return "<User %s>" % self._info
@ -33,6 +34,7 @@ class User(base.Resource):
class UserManager(base.ManagerWithFind): class UserManager(base.ManagerWithFind):
"""Manager class for manipulating Keystone users.""" """Manager class for manipulating Keystone users."""
resource_class = User resource_class = User
def __init__(self, client, role_manager): def __init__(self, client, role_manager):

View File

@ -39,6 +39,7 @@ class Domain(base.Resource):
* id: a uuid that identifies the domain * id: a uuid that identifies the domain
""" """
pass pass

View File

@ -123,12 +123,12 @@ class Client(httpclient.HTTPClient):
.. py:attribute:: endpoint_filter .. py:attribute:: endpoint_filter
:py:class:`keystoneclient.v3.contrib.endpoint_filter.\ :py:class:`keystoneclient.v3.contrib.endpoint_filter.\
EndpointFilterManager` EndpointFilterManager`
.. py:attribute:: endpoint_policy .. py:attribute:: endpoint_policy
:py:class:`keystoneclient.v3.contrib.endpoint_policy.\ :py:class:`keystoneclient.v3.contrib.endpoint_policy.\
EndpointPolicyManager` EndpointPolicyManager`
.. py:attribute:: endpoints .. py:attribute:: endpoints

View File

@ -21,6 +21,7 @@ from keystoneclient.v3 import projects
class EndpointFilterManager(base.Manager): class EndpointFilterManager(base.Manager):
"""Manager class for manipulating project-endpoint associations.""" """Manager class for manipulating project-endpoint associations."""
OS_EP_FILTER_EXT = '/OS-EP-FILTER' OS_EP_FILTER_EXT = '/OS-EP-FILTER'
def _build_base_url(self, project=None, endpoint=None): def _build_base_url(self, project=None, endpoint=None):

View File

@ -22,6 +22,7 @@ from keystoneclient import exceptions
@six.add_metaclass(abc.ABCMeta) @six.add_metaclass(abc.ABCMeta)
class EntityManager(base.Manager): class EntityManager(base.Manager):
"""Manager class for listing federated accessible objects.""" """Manager class for listing federated accessible objects."""
resource_class = None resource_class = None
@abc.abstractproperty @abc.abstractproperty

View File

@ -22,6 +22,7 @@ class IdentityProvider(base.Resource):
* id: user-defined unique string identifying Identity Provider. * id: user-defined unique string identifying Identity Provider.
""" """
pass pass

View File

@ -22,6 +22,7 @@ class Mapping(base.Resource):
* id: user defined unique string identifying mapping. * id: user defined unique string identifying mapping.
""" """
pass pass

View File

@ -23,6 +23,7 @@ class Protocol(base.Resource):
federation protocol. federation protocol.
""" """
pass pass

View File

@ -24,6 +24,7 @@ class ServiceProvider(base.Resource):
* auth_url: the authentication url of Service Provider. * auth_url: the authentication url of Service Provider.
""" """
pass pass

View File

@ -29,6 +29,7 @@ class AccessToken(base.Resource):
class AccessTokenManager(base.CrudManager): class AccessTokenManager(base.CrudManager):
"""Manager class for manipulating identity OAuth access tokens.""" """Manager class for manipulating identity OAuth access tokens."""
resource_class = AccessToken resource_class = AccessToken
def create(self, consumer_key, consumer_secret, request_key, def create(self, consumer_key, consumer_secret, request_key,

View File

@ -22,11 +22,13 @@ class Consumer(base.Resource):
* id: a uuid that identifies the consumer * id: a uuid that identifies the consumer
* description: a short description of the consumer * description: a short description of the consumer
""" """
pass pass
class ConsumerManager(base.CrudManager): class ConsumerManager(base.CrudManager):
"""Manager class for manipulating identity consumers.""" """Manager class for manipulating identity consumers."""
resource_class = Consumer resource_class = Consumer
collection_key = 'consumers' collection_key = 'consumers'
key = 'consumer' key = 'consumer'

View File

@ -38,6 +38,7 @@ class RequestToken(base.Resource):
class RequestTokenManager(base.CrudManager): class RequestTokenManager(base.CrudManager):
"""Manager class for manipulating identity OAuth request tokens.""" """Manager class for manipulating identity OAuth request tokens."""
resource_class = RequestToken resource_class = RequestToken
def authorize(self, request_token, roles): def authorize(self, request_token, roles):

View File

@ -26,11 +26,13 @@ class Trust(base.Resource):
* trustee_user_id: a uuid that identifies the trustee * trustee_user_id: a uuid that identifies the trustee
* trustor_user_id: a uuid that identifies the trustor * trustor_user_id: a uuid that identifies the trustor
""" """
pass pass
class TrustManager(base.CrudManager): class TrustManager(base.CrudManager):
"""Manager class for manipulating Trusts.""" """Manager class for manipulating Trusts."""
resource_class = Trust resource_class = Trust
collection_key = 'trusts' collection_key = 'trusts'
key = 'trust' key = 'trust'

View File

@ -32,11 +32,13 @@ class Credential(base.Resource):
* project_id: project ID (optional) * project_id: project ID (optional)
""" """
pass pass
class CredentialManager(base.CrudManager): class CredentialManager(base.CrudManager):
"""Manager class for manipulating Identity credentials.""" """Manager class for manipulating Identity credentials."""
resource_class = Credential resource_class = Credential
collection_key = 'credentials' collection_key = 'credentials'
key = 'credential' key = 'credential'

View File

@ -26,11 +26,13 @@ class Domain(base.Resource):
* id: a uuid that identifies the domain * id: a uuid that identifies the domain
""" """
pass pass
class DomainManager(base.CrudManager): class DomainManager(base.CrudManager):
"""Manager class for manipulating Identity domains.""" """Manager class for manipulating Identity domains."""
resource_class = Domain resource_class = Domain
collection_key = 'domains' collection_key = 'domains'
key = 'domain' key = 'domain'

View File

@ -36,11 +36,13 @@ class Endpoint(base.Resource):
* enabled: determines whether the endpoint appears in the catalog * enabled: determines whether the endpoint appears in the catalog
""" """
pass pass
class EndpointManager(base.CrudManager): class EndpointManager(base.CrudManager):
"""Manager class for manipulating Identity endpoints.""" """Manager class for manipulating Identity endpoints."""
resource_class = Endpoint resource_class = Endpoint
collection_key = 'endpoints' collection_key = 'endpoints'
key = 'endpoint' key = 'endpoint'

View File

@ -28,6 +28,7 @@ class Group(base.Resource):
* description: group description * description: group description
""" """
@positional(enforcement=positional.WARN) @positional(enforcement=positional.WARN)
def update(self, name=None, description=None): def update(self, name=None, description=None):
kwargs = { kwargs = {
@ -48,6 +49,7 @@ class Group(base.Resource):
class GroupManager(base.CrudManager): class GroupManager(base.CrudManager):
"""Manager class for manipulating Identity groups.""" """Manager class for manipulating Identity groups."""
resource_class = Group resource_class = Group
collection_key = 'groups' collection_key = 'groups'
key = 'group' key = 'group'

View File

@ -28,6 +28,7 @@ class Policy(base.Resource):
* type: the mime type of the policy blob * type: the mime type of the policy blob
""" """
@positional(enforcement=positional.WARN) @positional(enforcement=positional.WARN)
def update(self, blob=None, type=None): def update(self, blob=None, type=None):
kwargs = { kwargs = {
@ -46,6 +47,7 @@ class Policy(base.Resource):
class PolicyManager(base.CrudManager): class PolicyManager(base.CrudManager):
"""Manager class for manipulating Identity policies.""" """Manager class for manipulating Identity policies."""
resource_class = Policy resource_class = Policy
collection_key = 'policies' collection_key = 'policies'
key = 'policy' key = 'policy'

View File

@ -36,6 +36,7 @@ class Project(base.Resource):
project in the hierarchy project in the hierarchy
""" """
@positional(enforcement=positional.WARN) @positional(enforcement=positional.WARN)
def update(self, name=None, description=None, enabled=None): def update(self, name=None, description=None, enabled=None):
kwargs = { kwargs = {
@ -57,6 +58,7 @@ class Project(base.Resource):
class ProjectManager(base.CrudManager): class ProjectManager(base.CrudManager):
"""Manager class for manipulating Identity projects.""" """Manager class for manipulating Identity projects."""
resource_class = Project resource_class = Project
collection_key = 'projects' collection_key = 'projects'
key = 'project' key = 'project'

View File

@ -25,11 +25,13 @@ class Region(base.Resource):
* enabled: determines whether the endpoint appears in the catalog. * enabled: determines whether the endpoint appears in the catalog.
Defaults to True Defaults to True
""" """
pass pass
class RegionManager(base.CrudManager): class RegionManager(base.CrudManager):
"""Manager class for manipulating Identity regions.""" """Manager class for manipulating Identity regions."""
resource_class = Region resource_class = Region
collection_key = 'regions' collection_key = 'regions'
key = 'region' key = 'region'

View File

@ -25,11 +25,13 @@ class RoleAssignment(base.Resource):
* scope: an object which has either a project or domain object * scope: an object which has either a project or domain object
containing an uuid containing an uuid
""" """
pass pass
class RoleAssignmentManager(base.CrudManager): class RoleAssignmentManager(base.CrudManager):
"""Manager class for manipulating Identity roles assignments.""" """Manager class for manipulating Identity roles assignments."""
resource_class = RoleAssignment resource_class = RoleAssignment
collection_key = 'role_assignments' collection_key = 'role_assignments'
key = 'role_assignment' key = 'role_assignment'

View File

@ -30,6 +30,7 @@ class Role(base.Resource):
* domain: optional domain for the role * domain: optional domain for the role
""" """
pass pass
@ -41,11 +42,13 @@ class InferenceRule(base.Resource):
* implied_role: this role is implied by the other * implied_role: this role is implied by the other
""" """
pass pass
class RoleManager(base.CrudManager): class RoleManager(base.CrudManager):
"""Manager class for manipulating Identity roles.""" """Manager class for manipulating Identity roles."""
resource_class = Role resource_class = Role
collection_key = 'roles' collection_key = 'roles'
key = 'role' key = 'role'

View File

@ -29,11 +29,13 @@ class Service(base.Resource):
* enabled: determines whether the service appears in the catalog * enabled: determines whether the service appears in the catalog
""" """
pass pass
class ServiceManager(base.CrudManager): class ServiceManager(base.CrudManager):
"""Manager class for manipulating Identity services.""" """Manager class for manipulating Identity services."""
resource_class = Service resource_class = Service
collection_key = 'services' collection_key = 'services'
key = 'service' key = 'service'

View File

@ -33,11 +33,13 @@ class User(base.Resource):
* id: a uuid that identifies the user * id: a uuid that identifies the user
""" """
pass pass
class UserManager(base.CrudManager): class UserManager(base.CrudManager):
"""Manager class for manipulating Identity users.""" """Manager class for manipulating Identity users."""
resource_class = User resource_class = User
collection_key = 'users' collection_key = 'users'
key = 'user' key = 'user'

View File

@ -49,10 +49,7 @@ passenv = OS_*
# D200: One-line docstring should fit on one line with quotes # D200: One-line docstring should fit on one line with quotes
# D202: No blank lines allowed after function docstring # D202: No blank lines allowed after function docstring
# D203: 1 blank required before class docstring. # D203: 1 blank required before class docstring.
# D204: 1 blank required after class docstring ignore = D100,D101,D102,D103,D104,D105,D200,D202,D203
# D205: Blank line required between one-line summary and description.
# D207: Docstring is under-indented
ignore = D100,D101,D102,D103,D104,D105,D200,D202,D203,D204,D205,D207
show-source = True show-source = True
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common* exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*