diff --git a/keystone/auth/controllers.py b/keystone/auth/controllers.py index 800927e0a7..2c5d71d566 100644 --- a/keystone/auth/controllers.py +++ b/keystone/auth/controllers.py @@ -93,6 +93,7 @@ class AuthContext(dict): earliest value. """ + # identity attributes need to be reconciled among the auth plugins IDENTITY_ATTRIBUTES = frozenset(['user_id', 'project_id', 'access_token_id', 'domain_id', diff --git a/keystone/auth/plugins/external.py b/keystone/auth/plugins/external.py index 72b2e9f1e6..b00b808aec 100644 --- a/keystone/auth/plugins/external.py +++ b/keystone/auth/plugins/external.py @@ -93,6 +93,7 @@ class Domain(Base): class KerberosDomain(Domain): """Allows `kerberos` as a method.""" + def _authenticate(self, remote_user, context): auth_type = context['environment'].get('AUTH_TYPE') if auth_type != 'Negotiate': diff --git a/keystone/common/cache/_memcache_pool.py b/keystone/common/cache/_memcache_pool.py index 2bfcc3bb13..ac1561f313 100644 --- a/keystone/common/cache/_memcache_pool.py +++ b/keystone/common/cache/_memcache_pool.py @@ -43,6 +43,7 @@ class _MemcacheClient(memcache.Client): methods overloaded by threading.local so we can reuse clients in different threads """ + __delattr__ = object.__delattr__ __getattribute__ = object.__getattribute__ __new__ = object.__new__ @@ -61,6 +62,7 @@ class ConnectionPool(queue.Queue): This class implements the basic connection pool logic as an abstract base class. """ + def __init__(self, maxsize, unused_timeout, conn_get_timeout=None): """Initialize the connection pool. diff --git a/keystone/common/cache/backends/noop.py b/keystone/common/cache/backends/noop.py index 2ea2507c98..eda06ec85d 100644 --- a/keystone/common/cache/backends/noop.py +++ b/keystone/common/cache/backends/noop.py @@ -33,6 +33,7 @@ class NoopCacheBackend(api.CacheBackend): mechanism to cleanup it's internal dict and therefore could cause run-away memory utilization. """ + def __init__(self, *args): return diff --git a/keystone/common/controller.py b/keystone/common/controller.py index 096d5a0398..89d9fea5ff 100644 --- a/keystone/common/controller.py +++ b/keystone/common/controller.py @@ -210,6 +210,7 @@ def filterprotected(*filters): class V2Controller(wsgi.Application): """Base controller class for Identity API v2.""" + def _normalize_domain_id(self, context, ref): """Fill in domain_id since v2 calls are not domain-aware. diff --git a/keystone/common/dependency.py b/keystone/common/dependency.py index 43749bcd1b..d52a1ec598 100644 --- a/keystone/common/dependency.py +++ b/keystone/common/dependency.py @@ -60,6 +60,7 @@ class UnresolvableDependencyException(Exception): See ``resolve_future_dependencies()`` for more details. """ + def __init__(self, name, targets): msg = _('Unregistered dependency: %(name)s for %(targets)s') % { 'name': name, 'targets': targets} diff --git a/keystone/common/driver_hints.py b/keystone/common/driver_hints.py index ff0a774cef..f11ad0ed06 100644 --- a/keystone/common/driver_hints.py +++ b/keystone/common/driver_hints.py @@ -45,6 +45,7 @@ class Hints(object): * ``type``: will always be 'filter' """ + def __init__(self): self.limit = None self.filters = list() diff --git a/keystone/common/kvs/backends/inmemdb.py b/keystone/common/kvs/backends/inmemdb.py index 77d0940ab1..379b54bff7 100644 --- a/keystone/common/kvs/backends/inmemdb.py +++ b/keystone/common/kvs/backends/inmemdb.py @@ -38,6 +38,7 @@ class MemoryBackend(api.CacheBackend): 'keystone.common.kvs.Memory' ) """ + def __init__(self, arguments): self._db = {} diff --git a/keystone/common/kvs/backends/memcached.py b/keystone/common/kvs/backends/memcached.py index a330c13061..463c0738c7 100644 --- a/keystone/common/kvs/backends/memcached.py +++ b/keystone/common/kvs/backends/memcached.py @@ -47,6 +47,7 @@ class MemcachedLock(object): http://amix.dk/blog/post/19386 """ + def __init__(self, client_fn, key, lock_timeout, max_lock_attempts): self.client_fn = client_fn self.key = "_lock" + key @@ -81,6 +82,7 @@ class MemcachedBackend(object): time `memcached`, `bmemcached`, `pylibmc` and `pooled_memcached` are valid). """ + def __init__(self, arguments): self._key_mangler = None self.raw_no_expiry_keys = set(arguments.pop('no_expiry_keys', set())) diff --git a/keystone/common/kvs/core.py b/keystone/common/kvs/core.py index 5caaa6e835..3c809fe706 100644 --- a/keystone/common/kvs/core.py +++ b/keystone/common/kvs/core.py @@ -76,6 +76,7 @@ class KeyValueStore(object): This manager also supports the concept of locking a given key resource to allow for a guaranteed atomic transaction to the backend. """ + def __init__(self, kvs_region): self.locking = True self._lock_timeout = 0 @@ -251,6 +252,7 @@ class KeyValueStore(object): class _LockWrapper(object): """weakref-capable threading.Lock wrapper.""" + def __init__(self, lock_timeout): self.lock = threading.Lock() self.lock_timeout = lock_timeout @@ -367,6 +369,7 @@ class KeyValueStoreLock(object): This is only a write lock, and will not prevent reads from occurring. """ + def __init__(self, mutex, key, locking_enabled=True, lock_timeout=0): self.mutex = mutex self.key = key diff --git a/keystone/common/ldap/core.py b/keystone/common/ldap/core.py index 1fb1460593..576cdce712 100644 --- a/keystone/common/ldap/core.py +++ b/keystone/common/ldap/core.py @@ -414,6 +414,7 @@ class LDAPHandler(object): derived classes. """ + @abc.abstractmethod def __init__(self, conn=None): self.conn = conn @@ -620,6 +621,7 @@ def _common_ldap_initialization(url, use_tls=False, tls_cacertfile=None, class MsgId(list): """Wrapper class to hold connection and msgid.""" + pass @@ -660,6 +662,7 @@ class PooledLDAPHandler(LDAPHandler): the methods in this class. """ + # Added here to allow override for testing Connector = ldappool.StateConnector auth_pool_prefix = 'auth_pool_' @@ -852,6 +855,7 @@ class KeystoneLDAPHandler(LDAPHandler): OpenStack. """ + def __init__(self, conn=None): super(KeystoneLDAPHandler, self).__init__(conn=conn) self.page_size = 0 @@ -1898,6 +1902,7 @@ class ProjectLdapStructureMixin(object): This is shared between the resource and assignment LDAP backends. """ + DEFAULT_OU = 'ou=Groups' DEFAULT_STRUCTURAL_CLASSES = [] DEFAULT_OBJECTCLASS = 'groupOfNames' diff --git a/keystone/common/models.py b/keystone/common/models.py index 0bb37319b8..3a87ed92f7 100644 --- a/keystone/common/models.py +++ b/keystone/common/models.py @@ -21,6 +21,7 @@ Unless marked otherwise, all fields are strings. class Model(dict): """Base model class.""" + def __hash__(self): return self['id'].__hash__() diff --git a/keystone/common/utils.py b/keystone/common/utils.py index c08447f7be..2b47be5240 100644 --- a/keystone/common/utils.py +++ b/keystone/common/utils.py @@ -81,6 +81,7 @@ def read_cached_file(filename, cache_info, reload_func=None): class SmarterEncoder(jsonutils.json.JSONEncoder): """Help for JSON encoding dict-like objects.""" + def default(self, obj): if not isinstance(obj, dict) and hasattr(obj, 'iteritems'): return dict(obj.iteritems()) @@ -89,6 +90,7 @@ class SmarterEncoder(jsonutils.json.JSONEncoder): class PKIEncoder(SmarterEncoder): """Special encoder to make token JSON a bit shorter.""" + item_separator = ',' key_separator = ':' diff --git a/keystone/common/wsgi.py b/keystone/common/wsgi.py index a60c6fdbfd..48509637e2 100644 --- a/keystone/common/wsgi.py +++ b/keystone/common/wsgi.py @@ -123,6 +123,7 @@ def best_match_language(req): class BaseApplication(object): """Base WSGI application wrapper. Subclasses need to implement __call__.""" + @classmethod def factory(cls, global_config, **local_config): """Used for paste app factories in paste.deploy config files. @@ -395,6 +396,7 @@ class Middleware(Application): behavior. """ + @classmethod def factory(cls, global_config, **local_config): """Used for paste app factories in paste.deploy config files. @@ -473,6 +475,7 @@ class Debug(Middleware): about the request and response. """ + @webob.dec.wsgify() def __call__(self, req): if not hasattr(LOG, 'isEnabledFor') or LOG.isEnabledFor(LOG.debug): @@ -596,6 +599,7 @@ class ExtensionRouter(Router): Expects to be subclassed. """ + def __init__(self, application, mapper=None): if mapper is None: mapper = routes.Mapper() diff --git a/keystone/contrib/endpoint_filter/backends/sql.py b/keystone/contrib/endpoint_filter/backends/sql.py index cf904268af..6926101a18 100644 --- a/keystone/contrib/endpoint_filter/backends/sql.py +++ b/keystone/contrib/endpoint_filter/backends/sql.py @@ -20,6 +20,7 @@ from keystone.i18n import _ class ProjectEndpoint(sql.ModelBase, sql.ModelDictMixin): """project-endpoint relationship table.""" + __tablename__ = 'project_endpoint' attributes = ['endpoint_id', 'project_id'] endpoint_id = sql.Column(sql.String(64), @@ -32,6 +33,7 @@ class ProjectEndpoint(sql.ModelBase, sql.ModelDictMixin): class EndpointGroup(sql.ModelBase, sql.ModelDictMixin): """Endpoint Groups table.""" + __tablename__ = 'endpoint_group' attributes = ['id', 'name', 'description', 'filters'] mutable_attributes = frozenset(['name', 'description', 'filters']) @@ -43,6 +45,7 @@ class EndpointGroup(sql.ModelBase, sql.ModelDictMixin): class ProjectEndpointGroupMembership(sql.ModelBase, sql.ModelDictMixin): """Project to Endpoint group relationship table.""" + __tablename__ = 'project_endpoint_group' attributes = ['endpoint_group_id', 'project_id'] endpoint_group_id = sql.Column(sql.String(64), diff --git a/keystone/contrib/endpoint_filter/routers.py b/keystone/contrib/endpoint_filter/routers.py index 285b9df267..d5c4387870 100644 --- a/keystone/contrib/endpoint_filter/routers.py +++ b/keystone/contrib/endpoint_filter/routers.py @@ -64,6 +64,7 @@ class EndpointFilterExtension(wsgi.V3ExtensionRouter): {project_id} """ + PATH_PREFIX = '/OS-EP-FILTER' PATH_PROJECT_ENDPOINT = '/projects/{project_id}/endpoints/{endpoint_id}' PATH_ENDPOINT_GROUPS = '/endpoint_groups/{endpoint_group_id}' diff --git a/keystone/contrib/federation/controllers.py b/keystone/contrib/federation/controllers.py index 756ce2611f..278a1f4d3c 100644 --- a/keystone/contrib/federation/controllers.py +++ b/keystone/contrib/federation/controllers.py @@ -51,6 +51,7 @@ class _ControllerBase(controller.V3Controller): @dependency.requires('federation_api') class IdentityProvider(_ControllerBase): """Identity Provider representation.""" + collection_name = 'identity_providers' member_name = 'identity_provider' @@ -129,6 +130,7 @@ class FederationProtocol(_ControllerBase): and _public_parameters class attributes. """ + collection_name = 'protocols' member_name = 'protocol' diff --git a/keystone/contrib/federation/routers.py b/keystone/contrib/federation/routers.py index ddf2f61f17..686ddf41b2 100644 --- a/keystone/contrib/federation/routers.py +++ b/keystone/contrib/federation/routers.py @@ -91,6 +91,7 @@ class FederationExtension(wsgi.V3ExtensionRouter): ?origin=https%3A//horizon.example.com """ + def _construct_url(self, suffix): return "/OS-FEDERATION/%s" % suffix diff --git a/keystone/contrib/federation/utils.py b/keystone/contrib/federation/utils.py index 4f186f04a8..0c5ccc919e 100644 --- a/keystone/contrib/federation/utils.py +++ b/keystone/contrib/federation/utils.py @@ -359,6 +359,7 @@ def get_assertion_params_from_env(context): class UserType(object): """User mapping type.""" + EPHEMERAL = 'ephemeral' LOCAL = 'local' @@ -368,6 +369,7 @@ class RuleProcessor(object): class _EvalType(object): """Mapping rule evaluation types.""" + ANY_ONE_OF = 'any_one_of' NOT_ANY_OF = 'not_any_of' BLACKLIST = 'blacklist' diff --git a/keystone/exception.py b/keystone/exception.py index eb449de281..8d858688d9 100644 --- a/keystone/exception.py +++ b/keystone/exception.py @@ -33,6 +33,7 @@ class Error(Exception): message_format. """ + code = None title = None message_format = None @@ -160,6 +161,7 @@ class PKITokenExpected(Error): class SecurityError(Error): """Avoids exposing details of security failures, unless in debug mode.""" + amendment = _('(Disable debug mode to suppress these details.)') def _build_message(self, message, **kwargs): @@ -255,6 +257,7 @@ class MetadataNotFound(NotFound): """(dolph): metadata is not a user-facing concept, so this exception should not be exposed """ + message_format = _("An unhandled exception has occurred:" " Could not find metadata.") @@ -373,6 +376,7 @@ class Conflict(Error): class UnexpectedError(SecurityError): """Avoids exposing details of failures, unless in debug mode.""" + _message_format = _("An unexpected error prevented the server " "from fulfilling your request.") diff --git a/keystone/identity/backends/sql.py b/keystone/identity/backends/sql.py index d37240eb1f..a899dbf5b0 100644 --- a/keystone/identity/backends/sql.py +++ b/keystone/identity/backends/sql.py @@ -61,6 +61,7 @@ class Group(sql.ModelBase, sql.DictBase): class UserGroupMembership(sql.ModelBase, sql.DictBase): """Group membership join table.""" + __tablename__ = 'user_group_membership' user_id = sql.Column(sql.String(64), sql.ForeignKey('user.id'), diff --git a/keystone/identity/core.py b/keystone/identity/core.py index 27b91a12de..573cbef0a0 100644 --- a/keystone/identity/core.py +++ b/keystone/identity/core.py @@ -92,6 +92,7 @@ class DomainConfigs(dict): the identity manager and driver can use. """ + configured = False driver = None _any_sql = False @@ -484,6 +485,7 @@ class Manager(manager.Manager): mapping by default is a more prudent way to introduce this functionality. """ + driver_namespace = 'keystone.identity' _USER = 'user' diff --git a/keystone/middleware/core.py b/keystone/middleware/core.py index b243f1a627..f7552bb5b5 100644 --- a/keystone/middleware/core.py +++ b/keystone/middleware/core.py @@ -106,6 +106,7 @@ class JsonBodyMiddleware(wsgi.Middleware): an underscore. """ + def process_request(self, request): # Abort early if we don't have any work to do params_json = request.body diff --git a/keystone/models/token_model.py b/keystone/models/token_model.py index 2032fd19c0..712b51f554 100644 --- a/keystone/models/token_model.py +++ b/keystone/models/token_model.py @@ -37,6 +37,7 @@ def _parse_and_normalize_time(time_data): class KeystoneToken(dict): """An in-memory representation that unifies v2 and v3 tokens.""" + # TODO(morganfainberg): Align this in-memory representation with the # objects in keystoneclient. This object should be eventually updated # to be the source of token data with the ability to emit any version diff --git a/keystone/notifications.py b/keystone/notifications.py index 484cd8dc90..4f2fbe1c87 100644 --- a/keystone/notifications.py +++ b/keystone/notifications.py @@ -166,6 +166,7 @@ class ManagerNotificationWrapper(object): notify_event_callbacks to in process listeners """ + def __init__(self, operation, resource_type, public=True, resource_id_arg_index=1, result_id_arg_attr=None): self.operation = operation diff --git a/keystone/tests/unit/backend/core_ldap.py b/keystone/tests/unit/backend/core_ldap.py index fa36b92683..8b72c62a80 100644 --- a/keystone/tests/unit/backend/core_ldap.py +++ b/keystone/tests/unit/backend/core_ldap.py @@ -86,6 +86,7 @@ class BaseBackendLdapCommon(object): class BaseBackendLdap(object): """Mixin class to set up an all-LDAP configuration.""" + def setUp(self): # NOTE(dstanek): The database must be setup prior to calling the # parent's setUp. The parent's setUp uses services (like @@ -137,6 +138,7 @@ class BaseBackendLdapIdentitySqlEverythingElseWithMapping(object): Setting backward_compatible_ids to False will enable this mapping. """ + def config_overrides(self): super(BaseBackendLdapIdentitySqlEverythingElseWithMapping, self).config_overrides() diff --git a/keystone/tests/unit/backend/role/test_ldap.py b/keystone/tests/unit/backend/role/test_ldap.py index dcf8abe258..c6db02f1ef 100644 --- a/keystone/tests/unit/backend/role/test_ldap.py +++ b/keystone/tests/unit/backend/role/test_ldap.py @@ -32,6 +32,7 @@ class LdapRoleCommon(core_ldap.BaseBackendLdapCommon, core_role.RoleTests): which should be run for all the various LDAP configurations we test. """ + pass @@ -42,6 +43,7 @@ class LdapRole(LdapRoleCommon, core_ldap.BaseBackendLdap, unit.TestCase): which only need to be run in a basic LDAP configurations. """ + def test_configurable_allowed_role_actions(self): role = {'id': u'fäké1', 'name': u'fäké1'} self.role_api.create_role(u'fäké1', role) @@ -151,6 +153,7 @@ class LdapIdentitySqlEverythingElseRole( core_ldap.BaseBackendLdapIdentitySqlEverythingElse, LdapRoleCommon, unit.TestCase): """Test Identity in LDAP, Everything else in SQL.""" + pass @@ -158,4 +161,5 @@ class LdapIdentitySqlEverythingElseWithMappingRole( LdapIdentitySqlEverythingElseRole, core_ldap.BaseBackendLdapIdentitySqlEverythingElseWithMapping): """Test ID mapping of default LDAP backend.""" + pass diff --git a/keystone/tests/unit/core.py b/keystone/tests/unit/core.py index 20e0a1c5ac..95b6fd6ea5 100644 --- a/keystone/tests/unit/core.py +++ b/keystone/tests/unit/core.py @@ -707,6 +707,7 @@ class TestCase(BaseTestCase): class SQLDriverOverrides(object): """A mixin for consolidating sql-specific test overrides.""" + def config_overrides(self): super(SQLDriverOverrides, self).config_overrides() # SQL specific driver overrides diff --git a/keystone/tests/unit/test_backend.py b/keystone/tests/unit/test_backend.py index 5a09a2f72f..4b08dd15d7 100644 --- a/keystone/tests/unit/test_backend.py +++ b/keystone/tests/unit/test_backend.py @@ -136,6 +136,7 @@ class AssignmentTestHelperMixin(object): # 'inherited_to_projects' options to list_role_assignments.} """ + def _handle_project_spec(self, test_data, domain_id, project_spec, parent_id=None): """Handle the creation of a project or hierarchy of projects. diff --git a/keystone/tests/unit/test_backend_ldap.py b/keystone/tests/unit/test_backend_ldap.py index 79cd547775..32b5b3fba7 100644 --- a/keystone/tests/unit/test_backend_ldap.py +++ b/keystone/tests/unit/test_backend_ldap.py @@ -2415,6 +2415,7 @@ class LdapIdentitySqlAssignmentWithMapping(LdapIdentitySqlAssignment): Setting backward_compatible_ids to False will enable this mapping. """ + def config_overrides(self): super(LdapIdentitySqlAssignmentWithMapping, self).config_overrides() self.config_fixture.config(group='identity_mapping', @@ -2579,6 +2580,7 @@ class MultiLDAPandSQLIdentity(BaseLDAPIdentity, unit.SQLDriverOverrides, domain. """ + def setUp(self): sqldb = self.useFixture(database.Database()) super(MultiLDAPandSQLIdentity, self).setUp() @@ -3082,6 +3084,7 @@ class DomainSpecificLDAPandSQLIdentity( Although the default driver still exists, we don't use it. """ + def setUp(self): sqldb = self.useFixture(database.Database()) super(DomainSpecificLDAPandSQLIdentity, self).setUp() @@ -3246,6 +3249,7 @@ class DomainSpecificSQLIdentity(DomainSpecificLDAPandSQLIdentity): - A separate SQL backend for domain1 """ + def initial_setup(self, sqldb): # We aren't setting up any initial data ahead of switching to # domain-specific operation, so make the switch straight away. diff --git a/keystone/tests/unit/test_backend_ldap_pool.py b/keystone/tests/unit/test_backend_ldap_pool.py index 7c1fe010d1..bc8a28d1a9 100644 --- a/keystone/tests/unit/test_backend_ldap_pool.py +++ b/keystone/tests/unit/test_backend_ldap_pool.py @@ -211,6 +211,7 @@ class LdapIdentitySqlAssignment(LdapPoolCommonTestMixin, test_backend_ldap.LdapIdentitySqlAssignment, unit.TestCase): """Executes tests in existing base class with pooled LDAP handler.""" + def setUp(self): self.useFixture(mockpatch.PatchObject( ldap_core.PooledLDAPHandler, 'Connector', fakeldap.FakeLdapPool)) diff --git a/keystone/tests/unit/test_kvs.py b/keystone/tests/unit/test_kvs.py index 9fc74de26a..55a510058e 100644 --- a/keystone/tests/unit/test_kvs.py +++ b/keystone/tests/unit/test_kvs.py @@ -89,6 +89,7 @@ class TestMemcacheDriver(api.CacheBackend): """A test dogpile.cache backend that conforms to the mixin-mechanism for overriding set and set_multi methods on dogpile memcached drivers. """ + class test_client(object): # FIXME(morganfainberg): Convert this test client over to using mock # and/or mock.MagicMock as appropriate diff --git a/keystone/tests/unit/test_url_middleware.py b/keystone/tests/unit/test_url_middleware.py index 217b302d9b..3b160b93e0 100644 --- a/keystone/tests/unit/test_url_middleware.py +++ b/keystone/tests/unit/test_url_middleware.py @@ -20,6 +20,7 @@ from keystone.tests import unit class FakeApp(object): """Fakes a WSGI app URL normalized.""" + def __call__(self, env, start_response): resp = webob.Response() resp.body = 'SUCCESS' diff --git a/keystone/tests/unit/test_v2_controller.py b/keystone/tests/unit/test_v2_controller.py index 5f1f0a948b..e62c4e7dbf 100644 --- a/keystone/tests/unit/test_v2_controller.py +++ b/keystone/tests/unit/test_v2_controller.py @@ -33,6 +33,7 @@ class TenantTestCase(unit.TestCase): These tests exercise :class:`keystone.assignment.controllers.Tenant`. """ + def setUp(self): super(TenantTestCase, self).setUp() self.useFixture(database.Database()) diff --git a/keystone/tests/unit/test_v3.py b/keystone/tests/unit/test_v3.py index a6323c1b89..16850fe308 100644 --- a/keystone/tests/unit/test_v3.py +++ b/keystone/tests/unit/test_v3.py @@ -39,6 +39,7 @@ TIME_FORMAT = unit.TIME_FORMAT class AuthTestMixin(object): """To hold auth building helper functions.""" + def build_auth_scope(self, project_id=None, project_name=None, project_domain_id=None, project_domain_name=None, domain_id=None, domain_name=None, trust_id=None, @@ -1284,6 +1285,7 @@ class JsonHomeTestMixin(object): data must be in the response. """ + def test_get_json_home(self): resp = self.get('/', convert=False, headers={'Accept': 'application/json-home'}) diff --git a/keystone/tests/unit/test_v3_assignment.py b/keystone/tests/unit/test_v3_assignment.py index 9eb6747f1f..41c63bd805 100644 --- a/keystone/tests/unit/test_v3_assignment.py +++ b/keystone/tests/unit/test_v3_assignment.py @@ -3099,6 +3099,7 @@ class AssignmentInheritanceDisabledTestCase(test_v3.RestfulTestCase): class AssignmentV3toV2MethodsTestCase(unit.TestCase): """Test domain V3 to V2 conversion methods.""" + def _setup_initial_projects(self): self.project_id = uuid.uuid4().hex self.domain_id = CONF.identity.default_domain_id diff --git a/keystone/tests/unit/test_v3_controller.py b/keystone/tests/unit/test_v3_controller.py index 563e656eb8..97ed5c5309 100644 --- a/keystone/tests/unit/test_v3_controller.py +++ b/keystone/tests/unit/test_v3_controller.py @@ -25,6 +25,7 @@ from keystone.tests import unit class V3ControllerTestCase(unit.TestCase): """Tests for the V3Controller class.""" + def setUp(self): super(V3ControllerTestCase, self).setUp() diff --git a/keystone/tests/unit/test_v3_credential.py b/keystone/tests/unit/test_v3_credential.py index 4e18d92560..a4e4421550 100644 --- a/keystone/tests/unit/test_v3_credential.py +++ b/keystone/tests/unit/test_v3_credential.py @@ -53,6 +53,7 @@ class CredentialBaseTestCase(test_v3.RestfulTestCase): class CredentialTestCase(CredentialBaseTestCase): """Test credential CRUD.""" + def setUp(self): super(CredentialTestCase, self).setUp() @@ -284,6 +285,7 @@ class CredentialTestCase(CredentialBaseTestCase): class TestCredentialTrustScoped(test_v3.RestfulTestCase): """Test credential with trust scoped token.""" + def setUp(self): super(TestCredentialTrustScoped, self).setUp() @@ -356,6 +358,7 @@ class TestCredentialTrustScoped(test_v3.RestfulTestCase): class TestCredentialEc2(CredentialBaseTestCase): """Test v3 credential compatibility with ec2tokens.""" + def setUp(self): super(TestCredentialEc2, self).setUp() diff --git a/keystone/tests/unit/test_v3_federation.py b/keystone/tests/unit/test_v3_federation.py index a873f856e2..1c12c9e26d 100644 --- a/keystone/tests/unit/test_v3_federation.py +++ b/keystone/tests/unit/test_v3_federation.py @@ -2438,6 +2438,7 @@ class FederatedTokenTestsMethodToken(FederatedTokenTests): way for scoping all the tokens. """ + AUTH_METHOD = 'token' def auth_plugin_config_override(self): diff --git a/keystone/tests/unit/test_v3_filters.py b/keystone/tests/unit/test_v3_filters.py index 1bb4987245..31d7a47fc2 100644 --- a/keystone/tests/unit/test_v3_filters.py +++ b/keystone/tests/unit/test_v3_filters.py @@ -324,6 +324,7 @@ class IdentityTestFilteredCase(filtering.FilterTests, class IdentityTestListLimitCase(IdentityTestFilteredCase): """Test list limiting enforcement on the v3 Identity API.""" + content_type = 'json' def setUp(self): diff --git a/keystone/token/controllers.py b/keystone/token/controllers.py index 74c658c408..85f7bf2b05 100644 --- a/keystone/token/controllers.py +++ b/keystone/token/controllers.py @@ -38,6 +38,7 @@ LOG = log.getLogger(__name__) class ExternalAuthNotApplicable(Exception): """External authentication is not applicable.""" + pass diff --git a/keystone/token/persistence/core.py b/keystone/token/persistence/core.py index 46e4c523b1..865011e152 100644 --- a/keystone/token/persistence/core.py +++ b/keystone/token/persistence/core.py @@ -206,6 +206,7 @@ class Manager(object): This class is a proxy class to the token_provider_api's persistence manager. """ + def __init__(self): # NOTE(morganfainberg): __init__ is required for dependency processing. super(Manager, self).__init__() diff --git a/keystone/token/providers/common.py b/keystone/token/providers/common.py index b71458cd83..a41f7ec5af 100644 --- a/keystone/token/providers/common.py +++ b/keystone/token/providers/common.py @@ -235,6 +235,7 @@ class V2TokenDataHelper(object): 'identity_api', 'resource_api', 'role_api', 'trust_api') class V3TokenDataHelper(object): """Token data helper.""" + def __init__(self): # Keep __init__ around to ensure dependency injection works. super(V3TokenDataHelper, self).__init__() diff --git a/tox.ini b/tox.ini index c9cd71af72..f4c969dbbf 100644 --- a/tox.ini +++ b/tox.ini @@ -111,11 +111,10 @@ show-source = true # D105: Missing docstring in magic method # D202: No blank lines allowed after 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. # D400: First line should end with a period. # D401: First line should be in imperative mood. -ignore = H405,D100,D101,D102,D103,D104,D105,D203,D204,D205,D400,D401 +ignore = H405,D100,D101,D102,D103,D104,D105,D203,D205,D400,D401 exclude=.venv,.git,.tox,build,dist,doc,*openstack/common*,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot max-complexity=24