nit: remove some useless code
Remove some uneless code Change-Id: I6ccf470ef41c858c9aac90c8ce03dcfdb5468b82
This commit is contained in:
parent
3b13b4e5e7
commit
19cd84b840
|
@ -16,7 +16,6 @@
|
|||
|
||||
import os
|
||||
|
||||
import dogpile.cache
|
||||
from dogpile.cache import region
|
||||
from dogpile.cache import util
|
||||
from oslo_cache import core as cache
|
||||
|
@ -182,21 +181,3 @@ def get_memoization_decorator(group, expiration_group=None, region=None):
|
|||
region = CACHE_REGION
|
||||
return cache.get_memoization_decorator(CONF, region, group,
|
||||
expiration_group=expiration_group)
|
||||
|
||||
|
||||
# NOTE(stevemar): When memcache_pool, mongo and noop backends are removed
|
||||
# we no longer need to register the backends here.
|
||||
dogpile.cache.register_backend(
|
||||
'keystone.common.cache.noop',
|
||||
'keystone.common.cache.backends.noop',
|
||||
'NoopCacheBackend')
|
||||
|
||||
dogpile.cache.register_backend(
|
||||
'keystone.cache.mongo',
|
||||
'keystone.common.cache.backends.mongo',
|
||||
'MongoCacheBackend')
|
||||
|
||||
dogpile.cache.register_backend(
|
||||
'keystone.cache.memcache_pool',
|
||||
'keystone.common.cache.backends.memcache_pool',
|
||||
'PooledMemcachedBackend')
|
||||
|
|
|
@ -96,12 +96,6 @@ def hash_user_password(user):
|
|||
return dict(user, password=hash_password(password))
|
||||
|
||||
|
||||
def hash_password_compat(password):
|
||||
password_utf8 = verify_length_and_trunc_password(password).encode('utf-8')
|
||||
return passlib.hash.sha512_crypt.using(rounds=CONF.crypt_strength).hash(
|
||||
password_utf8)
|
||||
|
||||
|
||||
def hash_password(password):
|
||||
"""Hash a password. Harder."""
|
||||
params = {}
|
||||
|
|
|
@ -126,29 +126,6 @@ def add_constraints(constraints):
|
|||
refcolumns=[constraint_def['ref_column']]).create()
|
||||
|
||||
|
||||
def rename_tables_with_constraints(renames, constraints, engine):
|
||||
"""Rename tables with foreign key constraints.
|
||||
|
||||
Tables are renamed after first removing constraints. The constraints are
|
||||
replaced after the rename is complete.
|
||||
|
||||
This works on databases that don't support renaming tables that have
|
||||
constraints on them (DB2).
|
||||
|
||||
`renames` is a dict, mapping {'to_table_name': from_table, ...}
|
||||
"""
|
||||
if engine.name != 'sqlite':
|
||||
# SQLite doesn't support constraints, so nothing to remove.
|
||||
remove_constraints(constraints)
|
||||
|
||||
for to_table_name in renames:
|
||||
from_table = renames[to_table_name]
|
||||
from_table.rename(to_table_name)
|
||||
|
||||
if engine != 'sqlite':
|
||||
add_constraints(constraints)
|
||||
|
||||
|
||||
def find_repo(repo_name):
|
||||
"""Return the absolute path to the named repository."""
|
||||
path = os.path.abspath(os.path.join(
|
||||
|
|
|
@ -49,14 +49,3 @@ def nullable(property_schema):
|
|||
# In the enum the 'null' is NoneType
|
||||
new_schema['enum'].append(None)
|
||||
return new_schema
|
||||
|
||||
|
||||
def add_array_type(property_schema):
|
||||
"""Convert the parameter schema to be of type list.
|
||||
|
||||
:param dict property_schema: schema to add array type to
|
||||
:returns: a new dict schema
|
||||
"""
|
||||
new_schema = property_schema.copy()
|
||||
new_schema['type'] = [property_schema['type'], 'array']
|
||||
return new_schema
|
||||
|
|
Loading…
Reference in New Issue