summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavid Pustchi <npustchi@gmail.com>2016-05-03 18:08:31 +0000
committerNavid Pustchi <npustchi@gmail.com>2016-05-04 19:30:03 +0000
commita9adca02dbdbf786dd7015f4d3c67c514d757423 (patch)
tree75ba605bba406d61de5967f49f6b50c5d35b16ec
parente9471bdf4cb96816ff551cde6b6fdc1e9cb00d3e (diff)
downloadpython-keystoneclient-a9adca02dbdbf786dd7015f4d3c67c514d757423.tar.gz
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
-rw-r--r--keystoneclient/base.py2
-rw-r--r--keystoneclient/exceptions.py10
-rw-r--r--keystoneclient/session.py1
-rw-r--r--keystoneclient/tests/unit/test_keyring.py1
-rw-r--r--keystoneclient/v2_0/endpoints.py1
-rw-r--r--keystoneclient/v2_0/extensions.py1
-rw-r--r--keystoneclient/v2_0/roles.py2
-rw-r--r--keystoneclient/v2_0/services.py2
-rw-r--r--keystoneclient/v2_0/tenants.py2
-rw-r--r--keystoneclient/v2_0/users.py2
-rw-r--r--keystoneclient/v3/auth.py1
-rw-r--r--keystoneclient/v3/client.py4
-rw-r--r--keystoneclient/v3/contrib/endpoint_filter.py1
-rw-r--r--keystoneclient/v3/contrib/federation/base.py1
-rw-r--r--keystoneclient/v3/contrib/federation/identity_providers.py1
-rw-r--r--keystoneclient/v3/contrib/federation/mappings.py1
-rw-r--r--keystoneclient/v3/contrib/federation/protocols.py1
-rw-r--r--keystoneclient/v3/contrib/federation/service_providers.py1
-rw-r--r--keystoneclient/v3/contrib/oauth1/access_tokens.py1
-rw-r--r--keystoneclient/v3/contrib/oauth1/consumers.py2
-rw-r--r--keystoneclient/v3/contrib/oauth1/request_tokens.py1
-rw-r--r--keystoneclient/v3/contrib/trusts.py2
-rw-r--r--keystoneclient/v3/credentials.py2
-rw-r--r--keystoneclient/v3/domains.py2
-rw-r--r--keystoneclient/v3/endpoints.py2
-rw-r--r--keystoneclient/v3/groups.py2
-rw-r--r--keystoneclient/v3/policies.py2
-rw-r--r--keystoneclient/v3/projects.py2
-rw-r--r--keystoneclient/v3/regions.py2
-rw-r--r--keystoneclient/v3/role_assignments.py2
-rw-r--r--keystoneclient/v3/roles.py3
-rw-r--r--keystoneclient/v3/services.py2
-rw-r--r--keystoneclient/v3/users.py2
-rw-r--r--tox.ini5
34 files changed, 63 insertions, 6 deletions
diff --git a/keystoneclient/base.py b/keystoneclient/base.py
index ddd97fa..803df15 100644
--- a/keystoneclient/base.py
+++ b/keystoneclient/base.py
@@ -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
diff --git a/keystoneclient/exceptions.py b/keystoneclient/exceptions.py
index 83bf57a..2e3270a 100644
--- a/keystoneclient/exceptions.py
+++ b/keystoneclient/exceptions.py
@@ -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.')
diff --git a/keystoneclient/session.py b/keystoneclient/session.py
index 4ebcba1..ebcf854 100644
--- a/keystoneclient/session.py
+++ b/keystoneclient/session.py
@@ -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 = [
diff --git a/keystoneclient/tests/unit/test_keyring.py b/keystoneclient/tests/unit/test_keyring.py
index 2cd205d..7d30d98 100644
--- a/keystoneclient/tests/unit/test_keyring.py
+++ b/keystoneclient/tests/unit/test_keyring.py
@@ -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
diff --git a/keystoneclient/v2_0/endpoints.py b/keystoneclient/v2_0/endpoints.py
index 984be33..0f98c6c 100644
--- a/keystoneclient/v2_0/endpoints.py
+++ b/keystoneclient/v2_0/endpoints.py
@@ -18,6 +18,7 @@ from keystoneclient import base
class Endpoint(base.Resource):
"""Represents a Keystone endpoint."""
+
def __repr__(self):
return "<Endpoint %s>" % self._info
diff --git a/keystoneclient/v2_0/extensions.py b/keystoneclient/v2_0/extensions.py
index b805d31..6e772af 100644
--- a/keystoneclient/v2_0/extensions.py
+++ b/keystoneclient/v2_0/extensions.py
@@ -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
diff --git a/keystoneclient/v2_0/roles.py b/keystoneclient/v2_0/roles.py
index d0d43a8..bdda53c 100644
--- a/keystoneclient/v2_0/roles.py
+++ b/keystoneclient/v2_0/roles.py
@@ -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):
diff --git a/keystoneclient/v2_0/services.py b/keystoneclient/v2_0/services.py
index 4e6d3af..7a64f74 100644
--- a/keystoneclient/v2_0/services.py
+++ b/keystoneclient/v2_0/services.py
@@ -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):
diff --git a/keystoneclient/v2_0/tenants.py b/keystoneclient/v2_0/tenants.py
index 2c95ae1..a78a81f 100644
--- a/keystoneclient/v2_0/tenants.py
+++ b/keystoneclient/v2_0/tenants.py
@@ -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):
diff --git a/keystoneclient/v2_0/users.py b/keystoneclient/v2_0/users.py
index e62c244..77f24f3 100644
--- a/keystoneclient/v2_0/users.py
+++ b/keystoneclient/v2_0/users.py
@@ -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):
diff --git a/keystoneclient/v3/auth.py b/keystoneclient/v3/auth.py
index 121891b..c228586 100644
--- a/keystoneclient/v3/auth.py
+++ b/keystoneclient/v3/auth.py
@@ -39,6 +39,7 @@ class Domain(base.Resource):
* id: a uuid that identifies the domain
"""
+
pass
diff --git a/keystoneclient/v3/client.py b/keystoneclient/v3/client.py
index d3b2a24..619de60 100644
--- a/keystoneclient/v3/client.py
+++ b/keystoneclient/v3/client.py
@@ -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
diff --git a/keystoneclient/v3/contrib/endpoint_filter.py b/keystoneclient/v3/contrib/endpoint_filter.py
index 5e50da7..586a74a 100644
--- a/keystoneclient/v3/contrib/endpoint_filter.py
+++ b/keystoneclient/v3/contrib/endpoint_filter.py
@@ -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):
diff --git a/keystoneclient/v3/contrib/federation/base.py b/keystoneclient/v3/contrib/federation/base.py
index 0160170..6c095e7 100644
--- a/keystoneclient/v3/contrib/federation/base.py
+++ b/keystoneclient/v3/contrib/federation/base.py
@@ -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
diff --git a/keystoneclient/v3/contrib/federation/identity_providers.py b/keystoneclient/v3/contrib/federation/identity_providers.py
index e21a136..85c4a73 100644
--- a/keystoneclient/v3/contrib/federation/identity_providers.py
+++ b/keystoneclient/v3/contrib/federation/identity_providers.py
@@ -22,6 +22,7 @@ class IdentityProvider(base.Resource):
* id: user-defined unique string identifying Identity Provider.
"""
+
pass
diff --git a/keystoneclient/v3/contrib/federation/mappings.py b/keystoneclient/v3/contrib/federation/mappings.py
index 7e82931..0a46789 100644
--- a/keystoneclient/v3/contrib/federation/mappings.py
+++ b/keystoneclient/v3/contrib/federation/mappings.py
@@ -22,6 +22,7 @@ class Mapping(base.Resource):
* id: user defined unique string identifying mapping.
"""
+
pass
diff --git a/keystoneclient/v3/contrib/federation/protocols.py b/keystoneclient/v3/contrib/federation/protocols.py
index cbec448..7e2d46f 100644
--- a/keystoneclient/v3/contrib/federation/protocols.py
+++ b/keystoneclient/v3/contrib/federation/protocols.py
@@ -23,6 +23,7 @@ class Protocol(base.Resource):
federation protocol.
"""
+
pass
diff --git a/keystoneclient/v3/contrib/federation/service_providers.py b/keystoneclient/v3/contrib/federation/service_providers.py
index 17d458f..f731c39 100644
--- a/keystoneclient/v3/contrib/federation/service_providers.py
+++ b/keystoneclient/v3/contrib/federation/service_providers.py
@@ -24,6 +24,7 @@ class ServiceProvider(base.Resource):
* auth_url: the authentication url of Service Provider.
"""
+
pass
diff --git a/keystoneclient/v3/contrib/oauth1/access_tokens.py b/keystoneclient/v3/contrib/oauth1/access_tokens.py
index d45bf3f..b2d0e31 100644
--- a/keystoneclient/v3/contrib/oauth1/access_tokens.py
+++ b/keystoneclient/v3/contrib/oauth1/access_tokens.py
@@ -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,
diff --git a/keystoneclient/v3/contrib/oauth1/consumers.py b/keystoneclient/v3/contrib/oauth1/consumers.py
index 25e8ca1..5c81ff4 100644
--- a/keystoneclient/v3/contrib/oauth1/consumers.py
+++ b/keystoneclient/v3/contrib/oauth1/consumers.py
@@ -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'
diff --git a/keystoneclient/v3/contrib/oauth1/request_tokens.py b/keystoneclient/v3/contrib/oauth1/request_tokens.py
index 27f79c1..5d60bed 100644
--- a/keystoneclient/v3/contrib/oauth1/request_tokens.py
+++ b/keystoneclient/v3/contrib/oauth1/request_tokens.py
@@ -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):
diff --git a/keystoneclient/v3/contrib/trusts.py b/keystoneclient/v3/contrib/trusts.py
index 1b3033c..e236188 100644
--- a/keystoneclient/v3/contrib/trusts.py
+++ b/keystoneclient/v3/contrib/trusts.py
@@ -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'
diff --git a/keystoneclient/v3/credentials.py b/keystoneclient/v3/credentials.py
index 14e891e..28e1e08 100644
--- a/keystoneclient/v3/credentials.py
+++ b/keystoneclient/v3/credentials.py
@@ -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'
diff --git a/keystoneclient/v3/domains.py b/keystoneclient/v3/domains.py
index 7b6c4a1..466343f 100644
--- a/keystoneclient/v3/domains.py
+++ b/keystoneclient/v3/domains.py
@@ -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'
diff --git a/keystoneclient/v3/endpoints.py b/keystoneclient/v3/endpoints.py
index 1be1e22..e24ffaa 100644
--- a/keystoneclient/v3/endpoints.py
+++ b/keystoneclient/v3/endpoints.py
@@ -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'
diff --git a/keystoneclient/v3/groups.py b/keystoneclient/v3/groups.py
index 28e80d5..654ec34 100644
--- a/keystoneclient/v3/groups.py
+++ b/keystoneclient/v3/groups.py
@@ -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'
diff --git a/keystoneclient/v3/policies.py b/keystoneclient/v3/policies.py
index 661726d..9ab5387 100644
--- a/keystoneclient/v3/policies.py
+++ b/keystoneclient/v3/policies.py
@@ -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'
diff --git a/keystoneclient/v3/projects.py b/keystoneclient/v3/projects.py
index 0f52980..43d6d57 100644
--- a/keystoneclient/v3/projects.py
+++ b/keystoneclient/v3/projects.py
@@ -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'
diff --git a/keystoneclient/v3/regions.py b/keystoneclient/v3/regions.py
index f9b621f..dcf2bbe 100644
--- a/keystoneclient/v3/regions.py
+++ b/keystoneclient/v3/regions.py
@@ -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'
diff --git a/keystoneclient/v3/role_assignments.py b/keystoneclient/v3/role_assignments.py
index 71ae2c2..4602800 100644
--- a/keystoneclient/v3/role_assignments.py
+++ b/keystoneclient/v3/role_assignments.py
@@ -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'
diff --git a/keystoneclient/v3/roles.py b/keystoneclient/v3/roles.py
index bb77e3b..6d6b718 100644
--- a/keystoneclient/v3/roles.py
+++ b/keystoneclient/v3/roles.py
@@ -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'
diff --git a/keystoneclient/v3/services.py b/keystoneclient/v3/services.py
index c2b7aeb..02f88e8 100644
--- a/keystoneclient/v3/services.py
+++ b/keystoneclient/v3/services.py
@@ -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'
diff --git a/keystoneclient/v3/users.py b/keystoneclient/v3/users.py
index 89c529d..93fd7d4 100644
--- a/keystoneclient/v3/users.py
+++ b/keystoneclient/v3/users.py
@@ -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'
diff --git a/tox.ini b/tox.ini
index 16d7a5f..cd26e8f 100644
--- a/tox.ini
+++ b/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*