diff --git a/keystone/tests/test_backend_kvs.py b/keystone/tests/test_backend_kvs.py index 52b5003d9d..978190cbac 100644 --- a/keystone/tests/test_backend_kvs.py +++ b/keystone/tests/test_backend_kvs.py @@ -169,4 +169,4 @@ class KvsTokenCacheInvalidation(tests.TestCase, super(KvsTokenCacheInvalidation, self).config_overrides() self.config_fixture.config( group='token', - driver='keystone.token.backends.kvs.Token') + driver='keystone.token.persistence.backends.kvs.Token') diff --git a/keystone/tests/unit/token/test_token_persistence_proxy.py b/keystone/tests/unit/token/test_token_persistence_proxy.py deleted file mode 100644 index 11e7ad5339..0000000000 --- a/keystone/tests/unit/token/test_token_persistence_proxy.py +++ /dev/null @@ -1,86 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from keystone.common.kvs import core as kvs_core -from keystone import tests -from keystone import token -from keystone.token.backends import kvs as proxy_kvs -from keystone.token.backends import memcache as proxy_memcache -from keystone.token.backends import sql as proxy_sql -from keystone.token.persistence.backends import kvs -from keystone.token.persistence.backends import memcache -from keystone.token.persistence.backends import sql - - -class TokenPersistenceProxyTest(tests.BaseTestCase): - def test_symbols(self): - """Verify token persistence proxy symbols. - - The Token manager has been moved from `keystone.token.core` to - `keystone.token.persistence`. This test verifies that the symbols - resolve as expected. - - """ - self.assertTrue(issubclass(token.Manager, token.persistence.Manager)) - self.assertTrue(issubclass(token.Driver, token.persistence.Driver)) - - -class TokenPersistenceBackendSymbols(tests.TestCase): - def test_symbols(self): - """Verify the token persistence backend proxy symbols. - - Make sure that the modules that are (for compat reasons) located at - `keystone.token.backends` are the same as the new location - `keystone.token.persistence.backends`. - """ - self.assertTrue(issubclass(proxy_kvs.Token, kvs.Token)) - self.assertTrue(issubclass(proxy_memcache.Token, memcache.Token)) - self.assertTrue(issubclass(proxy_sql.Token, sql.Token)) - self.assertIs(proxy_sql.TokenModel, sql.TokenModel) - - def test_instantiation_kvs(self): - self.config_fixture.config( - group='token', - driver='keystone.token.backends.kvs.Token') - - # Clear the KVS registry so we can re-instantiate the KVS backend. This - # is required because the KVS core tries to limit duplication of - # CacheRegion objects and CacheRegion objects cannot be reconfigured. - kvs_core.KEY_VALUE_STORE_REGISTRY.clear() - - manager = token.persistence.PersistenceManager() - self.assertIsInstance(manager.driver, proxy_kvs.Token) - self.assertIsInstance(manager.driver, kvs.Token) - - def test_instantiation_memcache(self): - self.config_fixture.config( - group='token', - driver='keystone.token.backends.memcache.Token') - - # The memcache token backend is just a light wrapper around the KVS - # token backend. Clear the KVS registry so we can re-instantiate the - # KVS backend. This is required because the KVS core tries to limit - # duplication of CacheRegion objects and CacheRegion objects cannot be - # reconfigured. - kvs_core.KEY_VALUE_STORE_REGISTRY.clear() - - manager = token.persistence.PersistenceManager() - self.assertIsInstance(manager.driver, proxy_memcache.Token) - self.assertIsInstance(manager.driver, memcache.Token) - - def test_instantiation_sql(self): - self.config_fixture.config( - group='token', - driver='keystone.token.backends.sql.Token') - manager = token.persistence.PersistenceManager() - self.assertIsInstance(manager.driver, proxy_sql.Token) - self.assertIsInstance(manager.driver, sql.Token) diff --git a/keystone/token/backends/__init__.py b/keystone/token/backends/__init__.py deleted file mode 100644 index 927ecc97db..0000000000 --- a/keystone/token/backends/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# NOTE(morganfainberg): This package is for transition from the old token -# backend package location to the new one. This package is slated for removal -# in the Kilo development cycle. diff --git a/keystone/token/backends/kvs.py b/keystone/token/backends/kvs.py deleted file mode 100644 index 5407a154dc..0000000000 --- a/keystone/token/backends/kvs.py +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from keystone.openstack.common import versionutils -from keystone.token.persistence.backends import kvs - - -class Token(kvs.Token): - @versionutils.deprecated( - versionutils.deprecated.JUNO, - in_favor_of='keystone.token.persistence.backends.kvs.Token', - remove_in=+1, - what='keystone.token.backends.kvs.Token') - def __init__(self): - super(Token, self).__init__() diff --git a/keystone/token/backends/memcache.py b/keystone/token/backends/memcache.py deleted file mode 100644 index bd5df74dea..0000000000 --- a/keystone/token/backends/memcache.py +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from keystone.openstack.common import versionutils -from keystone.token.persistence.backends import memcache - - -class Token(memcache.Token): - @versionutils.deprecated( - versionutils.deprecated.JUNO, - in_favor_of='keystone.token.persistence.backends.memcache.Token', - remove_in=+1, - what='keystone.token.backends.memcache.Token') - def __init__(self): - super(Token, self).__init__() diff --git a/keystone/token/backends/sql.py b/keystone/token/backends/sql.py deleted file mode 100644 index 93aaa43e0a..0000000000 --- a/keystone/token/backends/sql.py +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from keystone.openstack.common import versionutils -from keystone.token.persistence.backends import sql - - -class Token(sql.Token): - @versionutils.deprecated( - versionutils.deprecated.JUNO, - in_favor_of='keystone.token.persistence.backends.sql.Token', - remove_in=+1, - what='keystone.token.backends.sql.Token') - def __init__(self): - super(Token, self).__init__() - - -TokenModel = sql.TokenModel