diff --git a/swh/storage/api/server.py b/swh/storage/api/server.py --- a/swh/storage/api/server.py +++ b/swh/storage/api/server.py @@ -93,20 +93,6 @@ if 'storage' not in cfg: raise KeyError("Missing '%storage' configuration") - if type == 'local': - vcfg = cfg['storage'] - cls = vcfg.get('cls') - if cls != 'local': - raise ValueError( - "The storage backend can only be started with a 'local' " - "configuration") - - args = vcfg['args'] - for key in ('db', 'objstorage'): - if not args.get(key): - raise ValueError( - "Invalid configuration; missing '%s' config entry" % key) - return cfg diff --git a/swh/storage/tests/test_server.py b/swh/storage/tests/test_server.py --- a/swh/storage/tests/test_server.py +++ b/swh/storage/tests/test_server.py @@ -3,7 +3,6 @@ # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information -import copy import pytest import yaml @@ -56,49 +55,6 @@ assert e.value.args[0] == 'Missing \'%storage\' configuration' -def test_load_and_check_config_remote_config_local_type_raise(tmpdir): - """'local' configuration without 'local' storage raises""" - config = { - 'storage': { - 'cls': 'remote', - 'args': {} - } - } - config_path = prepare_config_file(tmpdir, config) - with pytest.raises(ValueError) as e: - load_and_check_config(config_path, type='local') - - assert ( - e.value.args[0] == - "The storage backend can only be started with a 'local' configuration" - ) - - -def test_load_and_check_config_local_incomplete_configuration(tmpdir): - """Incomplete 'local' configuration should raise""" - config = { - 'storage': { - 'cls': 'local', - 'args': { - 'db': 'database', - 'objstorage': 'object_storage' - } - } - } - - for key in ('db', 'objstorage'): - c = copy.deepcopy(config) - c['storage']['args'].pop(key) - config_path = prepare_config_file(tmpdir, c) - with pytest.raises(ValueError) as e: - load_and_check_config(config_path) - - assert ( - e.value.args[0] == - "Invalid configuration; missing '%s' config entry" % key - ) - - def test_load_and_check_config_local_config_fine(tmpdir): """'Remote configuration is fine""" config = {