Changeset View
Changeset View
Standalone View
Standalone View
swh/vault/__init__.py
# Copyright (C) 2018 The Software Heritage developers | # Copyright (C) 2018-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import logging | import logging | ||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
Show All 23 Lines | elif cls == 'local': | ||||
from swh.vault.backend import VaultBackend as Vault | from swh.vault.backend import VaultBackend as Vault | ||||
args['cache'] = VaultCache(**args['cache']) | args['cache'] = VaultCache(**args['cache']) | ||||
args['storage'] = get_storage(**args['storage']) | args['storage'] = get_storage(**args['storage']) | ||||
args['scheduler'] = get_scheduler(**args['scheduler']) | args['scheduler'] = get_scheduler(**args['scheduler']) | ||||
else: | else: | ||||
raise ValueError('Unknown storage class `%s`' % cls) | raise ValueError('Unknown storage class `%s`' % cls) | ||||
logger.debug('Instantiating %s with %s' % (Vault, args)) | logger.debug('Instantiating %s with %s' % (Vault, args)) | ||||
return Vault(**args) | return Vault(**args) | ||||
def register(): | |||||
return {'tasks': '%s.cooking_tasks' % __name__} |