fixed config loading issue

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2022-03-16 14:21:56 +01:00
parent fc5ea9d6d1
commit 28750d06bd

View File

@ -9,13 +9,15 @@ from importlib import import_module
from planetmint.backend.utils import get_planetmint_config_value
BACKENDS = { # This is path to MongoDBClass
'tarantool_db': r'planetmint.backend.tarantool.connection.TarantoolDB',
'tarantool_db': 'planetmint.backend.tarantool.connection.TarantoolDB',
'localmongodb': 'planetmint.backend.localmongodb.connection.LocalMongoDBConnection'
}
logger = logging.getLogger(__name__)
backend = get_planetmint_config_value("backend")
if not backend:
backend = 'tarantool_db'
modulepath, _, class_name = BACKENDS[backend].rpartition('.')
current_backend = getattr(import_module(modulepath), class_name)