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:
parent
e9471bdf4c
commit
a9adca02db
|
@ -86,6 +86,7 @@ class Manager(object):
|
|||
:param client: instance of BaseClient descendant for HTTP requests
|
||||
|
||||
"""
|
||||
|
||||
resource_class = None
|
||||
|
||||
def __init__(self, client):
|
||||
|
@ -293,6 +294,7 @@ class CrudManager(Manager):
|
|||
refer to an individual member of the collection.
|
||||
|
||||
"""
|
||||
|
||||
collection_key = None
|
||||
key = None
|
||||
base_url = None
|
||||
|
|
|
@ -52,21 +52,25 @@ An alias of :py:exc:`keystoneauth1.exceptions.auth.AuthorizationFailure`
|
|||
|
||||
class ValidationError(ClientException):
|
||||
"""Error in validation on API client side."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class UnsupportedVersion(ClientException):
|
||||
"""User is trying to use an unsupported version of the API."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class CommandError(ClientException):
|
||||
"""Error in CLI tool."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class AuthPluginOptionsMissing(AuthorizationFailure):
|
||||
"""Auth plugin misses some options."""
|
||||
|
||||
def __init__(self, opt_names):
|
||||
super(AuthPluginOptionsMissing, self).__init__(
|
||||
_("Authentication failed. Missing options: %s") %
|
||||
|
@ -76,6 +80,7 @@ class AuthPluginOptionsMissing(AuthorizationFailure):
|
|||
|
||||
class AuthSystemNotFound(AuthorizationFailure):
|
||||
"""User has specified an AuthSystem that is not installed."""
|
||||
|
||||
def __init__(self, auth_system):
|
||||
super(AuthSystemNotFound, self).__init__(
|
||||
_("AuthSystemNotFound: %r") % auth_system)
|
||||
|
@ -84,6 +89,7 @@ class AuthSystemNotFound(AuthorizationFailure):
|
|||
|
||||
class NoUniqueMatch(ClientException):
|
||||
"""Multiple entities found instead of one."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
@ -102,6 +108,7 @@ An alias of :py:exc:`keystoneauth1.exceptions.catalog.EndpointNotFound`
|
|||
|
||||
class AmbiguousEndpoints(EndpointException):
|
||||
"""Found more than one matching endpoint in Service Catalog."""
|
||||
|
||||
def __init__(self, endpoints=None):
|
||||
super(AmbiguousEndpoints, self).__init__(
|
||||
_("AmbiguousEndpoints: %r") % endpoints)
|
||||
|
@ -132,6 +139,7 @@ An alias of :py:exc:`keystoneauth1.exceptions.http.HttpServerError`
|
|||
|
||||
class HTTPRedirection(HttpError):
|
||||
"""HTTP Redirection."""
|
||||
|
||||
message = _("HTTP Redirection")
|
||||
|
||||
|
||||
|
@ -353,6 +361,7 @@ HTTPError = HttpError
|
|||
|
||||
class CertificateConfigError(Exception):
|
||||
"""Error reading the certificate."""
|
||||
|
||||
def __init__(self, output):
|
||||
self.output = output
|
||||
msg = _('Unable to load certificate.')
|
||||
|
@ -361,6 +370,7 @@ class CertificateConfigError(Exception):
|
|||
|
||||
class CMSError(Exception):
|
||||
"""Error reading the certificate."""
|
||||
|
||||
def __init__(self, output):
|
||||
self.output = output
|
||||
msg = _('Unable to sign or verify data.')
|
||||
|
|
|
@ -953,6 +953,7 @@ class TCPKeepAliveAdapter(requests.adapters.HTTPAdapter):
|
|||
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
|
||||
"""
|
||||
|
||||
def init_poolmanager(self, *args, **kwargs):
|
||||
if 'socket_options' not in kwargs:
|
||||
socket_options = [
|
||||
|
|
|
@ -54,6 +54,7 @@ class KeyringTest(utils.TestCase):
|
|||
setting password, and allows easy password and key retrieval. Also
|
||||
records if a password was retrieved.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.key = None
|
||||
self.password = None
|
||||
|
|
|
@ -18,6 +18,7 @@ from keystoneclient import base
|
|||
|
||||
class Endpoint(base.Resource):
|
||||
"""Represents a Keystone endpoint."""
|
||||
|
||||
def __repr__(self):
|
||||
return "<Endpoint %s>" % self._info
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ from keystoneclient import base
|
|||
|
||||
class Extension(base.Resource):
|
||||
"""Represents an Identity API extension."""
|
||||
|
||||
def __repr__(self):
|
||||
return "<Extension %s>" % self._info
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ from keystoneclient import base
|
|||
|
||||
class Role(base.Resource):
|
||||
"""Represents a Keystone role."""
|
||||
|
||||
def __repr__(self):
|
||||
return "<Role %s>" % self._info
|
||||
|
||||
|
@ -28,6 +29,7 @@ class Role(base.Resource):
|
|||
|
||||
class RoleManager(base.ManagerWithFind):
|
||||
"""Manager class for manipulating Keystone roles."""
|
||||
|
||||
resource_class = Role
|
||||
|
||||
def get(self, role):
|
||||
|
|
|
@ -19,12 +19,14 @@ from keystoneclient import base
|
|||
|
||||
class Service(base.Resource):
|
||||
"""Represents a Keystone service."""
|
||||
|
||||
def __repr__(self):
|
||||
return "<Service %s>" % self._info
|
||||
|
||||
|
||||
class ServiceManager(base.ManagerWithFind):
|
||||
"""Manager class for manipulating Keystone services."""
|
||||
|
||||
resource_class = Service
|
||||
|
||||
def list(self):
|
||||
|
|
|
@ -32,6 +32,7 @@ class Tenant(base.Resource):
|
|||
* enabled: boolean to indicate if tenant is enabled
|
||||
|
||||
"""
|
||||
|
||||
def __repr__(self):
|
||||
return "<Tenant %s>" % self._info
|
||||
|
||||
|
@ -72,6 +73,7 @@ class Tenant(base.Resource):
|
|||
|
||||
class TenantManager(base.ManagerWithFind):
|
||||
"""Manager class for manipulating Keystone tenants."""
|
||||
|
||||
resource_class = Tenant
|
||||
|
||||
def __init__(self, client, role_manager, user_manager):
|
||||
|
|
|
@ -21,6 +21,7 @@ from keystoneclient import base
|
|||
|
||||
class User(base.Resource):
|
||||
"""Represents a Keystone user."""
|
||||
|
||||
def __repr__(self):
|
||||
return "<User %s>" % self._info
|
||||
|
||||
|
@ -33,6 +34,7 @@ class User(base.Resource):
|
|||
|
||||
class UserManager(base.ManagerWithFind):
|
||||
"""Manager class for manipulating Keystone users."""
|
||||
|
||||
resource_class = User
|
||||
|
||||
def __init__(self, client, role_manager):
|
||||
|
|
|
@ -39,6 +39,7 @@ class Domain(base.Resource):
|
|||
* id: a uuid that identifies the domain
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
@ -123,12 +123,12 @@ class Client(httpclient.HTTPClient):
|
|||
.. py:attribute:: endpoint_filter
|
||||
|
||||
:py:class:`keystoneclient.v3.contrib.endpoint_filter.\
|
||||
EndpointFilterManager`
|
||||
EndpointFilterManager`
|
||||
|
||||
.. py:attribute:: endpoint_policy
|
||||
|
||||
:py:class:`keystoneclient.v3.contrib.endpoint_policy.\
|
||||
EndpointPolicyManager`
|
||||
EndpointPolicyManager`
|
||||
|
||||
.. py:attribute:: endpoints
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ from keystoneclient.v3 import projects
|
|||
|
||||
class EndpointFilterManager(base.Manager):
|
||||
"""Manager class for manipulating project-endpoint associations."""
|
||||
|
||||
OS_EP_FILTER_EXT = '/OS-EP-FILTER'
|
||||
|
||||
def _build_base_url(self, project=None, endpoint=None):
|
||||
|
|
|
@ -22,6 +22,7 @@ from keystoneclient import exceptions
|
|||
@six.add_metaclass(abc.ABCMeta)
|
||||
class EntityManager(base.Manager):
|
||||
"""Manager class for listing federated accessible objects."""
|
||||
|
||||
resource_class = None
|
||||
|
||||
@abc.abstractproperty
|
||||
|
|
|
@ -22,6 +22,7 @@ class IdentityProvider(base.Resource):
|
|||
* id: user-defined unique string identifying Identity Provider.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ class Mapping(base.Resource):
|
|||
* id: user defined unique string identifying mapping.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ class Protocol(base.Resource):
|
|||
federation protocol.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ class ServiceProvider(base.Resource):
|
|||
* auth_url: the authentication url of Service Provider.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ class AccessToken(base.Resource):
|
|||
|
||||
class AccessTokenManager(base.CrudManager):
|
||||
"""Manager class for manipulating identity OAuth access tokens."""
|
||||
|
||||
resource_class = AccessToken
|
||||
|
||||
def create(self, consumer_key, consumer_secret, request_key,
|
||||
|
|
|
@ -22,11 +22,13 @@ class Consumer(base.Resource):
|
|||
* id: a uuid that identifies the consumer
|
||||
* description: a short description of the consumer
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class ConsumerManager(base.CrudManager):
|
||||
"""Manager class for manipulating identity consumers."""
|
||||
|
||||
resource_class = Consumer
|
||||
collection_key = 'consumers'
|
||||
key = 'consumer'
|
||||
|
|
|
@ -38,6 +38,7 @@ class RequestToken(base.Resource):
|
|||
|
||||
class RequestTokenManager(base.CrudManager):
|
||||
"""Manager class for manipulating identity OAuth request tokens."""
|
||||
|
||||
resource_class = RequestToken
|
||||
|
||||
def authorize(self, request_token, roles):
|
||||
|
|
|
@ -26,11 +26,13 @@ class Trust(base.Resource):
|
|||
* trustee_user_id: a uuid that identifies the trustee
|
||||
* trustor_user_id: a uuid that identifies the trustor
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class TrustManager(base.CrudManager):
|
||||
"""Manager class for manipulating Trusts."""
|
||||
|
||||
resource_class = Trust
|
||||
collection_key = 'trusts'
|
||||
key = 'trust'
|
||||
|
|
|
@ -32,11 +32,13 @@ class Credential(base.Resource):
|
|||
* project_id: project ID (optional)
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class CredentialManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity credentials."""
|
||||
|
||||
resource_class = Credential
|
||||
collection_key = 'credentials'
|
||||
key = 'credential'
|
||||
|
|
|
@ -26,11 +26,13 @@ class Domain(base.Resource):
|
|||
* id: a uuid that identifies the domain
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class DomainManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity domains."""
|
||||
|
||||
resource_class = Domain
|
||||
collection_key = 'domains'
|
||||
key = 'domain'
|
||||
|
|
|
@ -36,11 +36,13 @@ class Endpoint(base.Resource):
|
|||
* enabled: determines whether the endpoint appears in the catalog
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class EndpointManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity endpoints."""
|
||||
|
||||
resource_class = Endpoint
|
||||
collection_key = 'endpoints'
|
||||
key = 'endpoint'
|
||||
|
|
|
@ -28,6 +28,7 @@ class Group(base.Resource):
|
|||
* description: group description
|
||||
|
||||
"""
|
||||
|
||||
@positional(enforcement=positional.WARN)
|
||||
def update(self, name=None, description=None):
|
||||
kwargs = {
|
||||
|
@ -48,6 +49,7 @@ class Group(base.Resource):
|
|||
|
||||
class GroupManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity groups."""
|
||||
|
||||
resource_class = Group
|
||||
collection_key = 'groups'
|
||||
key = 'group'
|
||||
|
|
|
@ -28,6 +28,7 @@ class Policy(base.Resource):
|
|||
* type: the mime type of the policy blob
|
||||
|
||||
"""
|
||||
|
||||
@positional(enforcement=positional.WARN)
|
||||
def update(self, blob=None, type=None):
|
||||
kwargs = {
|
||||
|
@ -46,6 +47,7 @@ class Policy(base.Resource):
|
|||
|
||||
class PolicyManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity policies."""
|
||||
|
||||
resource_class = Policy
|
||||
collection_key = 'policies'
|
||||
key = 'policy'
|
||||
|
|
|
@ -36,6 +36,7 @@ class Project(base.Resource):
|
|||
project in the hierarchy
|
||||
|
||||
"""
|
||||
|
||||
@positional(enforcement=positional.WARN)
|
||||
def update(self, name=None, description=None, enabled=None):
|
||||
kwargs = {
|
||||
|
@ -57,6 +58,7 @@ class Project(base.Resource):
|
|||
|
||||
class ProjectManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity projects."""
|
||||
|
||||
resource_class = Project
|
||||
collection_key = 'projects'
|
||||
key = 'project'
|
||||
|
|
|
@ -25,11 +25,13 @@ class Region(base.Resource):
|
|||
* enabled: determines whether the endpoint appears in the catalog.
|
||||
Defaults to True
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class RegionManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity regions."""
|
||||
|
||||
resource_class = Region
|
||||
collection_key = 'regions'
|
||||
key = 'region'
|
||||
|
|
|
@ -25,11 +25,13 @@ class RoleAssignment(base.Resource):
|
|||
* scope: an object which has either a project or domain object
|
||||
containing an uuid
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class RoleAssignmentManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity roles assignments."""
|
||||
|
||||
resource_class = RoleAssignment
|
||||
collection_key = 'role_assignments'
|
||||
key = 'role_assignment'
|
||||
|
|
|
@ -30,6 +30,7 @@ class Role(base.Resource):
|
|||
* domain: optional domain for the role
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
@ -41,11 +42,13 @@ class InferenceRule(base.Resource):
|
|||
* implied_role: this role is implied by the other
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class RoleManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity roles."""
|
||||
|
||||
resource_class = Role
|
||||
collection_key = 'roles'
|
||||
key = 'role'
|
||||
|
|
|
@ -29,11 +29,13 @@ class Service(base.Resource):
|
|||
* enabled: determines whether the service appears in the catalog
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class ServiceManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity services."""
|
||||
|
||||
resource_class = Service
|
||||
collection_key = 'services'
|
||||
key = 'service'
|
||||
|
|
|
@ -33,11 +33,13 @@ class User(base.Resource):
|
|||
* id: a uuid that identifies the user
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class UserManager(base.CrudManager):
|
||||
"""Manager class for manipulating Identity users."""
|
||||
|
||||
resource_class = User
|
||||
collection_key = 'users'
|
||||
key = 'user'
|
||||
|
|
5
tox.ini
5
tox.ini
|
@ -49,10 +49,7 @@ passenv = OS_*
|
|||
# D200: One-line docstring should fit on one line with quotes
|
||||
# D202: No blank lines allowed after function docstring
|
||||
# D203: 1 blank required before class docstring.
|
||||
# D204: 1 blank required after class docstring
|
||||
# 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
|
||||
ignore = D100,D101,D102,D103,D104,D105,D200,D202,D203
|
||||
show-source = True
|
||||
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*
|
||||
|
||||
|
|
Loading…
Reference in New Issue