diff --git a/swh/indexer/storage/api/server.py b/swh/indexer/storage/api/server.py --- a/swh/indexer/storage/api/server.py +++ b/swh/indexer/storage/api/server.py @@ -86,10 +86,10 @@ if type == "local": vcfg = cfg["indexer_storage"] cls = vcfg.get("cls") - if cls != "local": + if cls not in ("local", "postgresql"): raise ValueError( "The indexer_storage backend can only be started with a " - "'local' configuration" + "'postgresql' configuration" ) if not vcfg.get("db"): diff --git a/swh/indexer/tests/storage/test_server.py b/swh/indexer/tests/storage/test_server.py --- a/swh/indexer/tests/storage/test_server.py +++ b/swh/indexer/tests/storage/test_server.py @@ -57,13 +57,13 @@ def test_load_and_check_config_remote_config_local_type_raise( class_storage, tmpdir ) -> None: - """Any other configuration than 'local' (the default) is rejected""" + """Any other configuration than 'postgresql' (the default) is rejected""" assert class_storage != "local" incompatible_config = {"indexer_storage": {"cls": class_storage}} config_path = prepare_config_file(tmpdir, incompatible_config) expected_error = ( - "The indexer_storage backend can only be started with a 'local' " + "The indexer_storage backend can only be started with a 'postgresql' " "configuration" ) with pytest.raises(ValueError, match=expected_error): @@ -82,8 +82,8 @@ def test_load_and_check_config_local_incomplete_configuration(tmpdir) -> None: - """Incomplete 'local' configuration should raise""" - config = {"indexer_storage": {"cls": "local"}} + """Incomplete 'postgresql' configuration should raise""" + config = {"indexer_storage": {"cls": "postgresql"}} expected_error = "Invalid configuration; missing 'db' config entry" config_path = prepare_config_file(tmpdir, config) @@ -95,10 +95,10 @@ """'Complete 'local' configuration is fine""" config = { "indexer_storage": { - "cls": "local", + "cls": "postgresql", "db": "db", } } config_path = prepare_config_file(tmpdir, config) - cfg = load_and_check_config(config_path, type="local") + cfg = load_and_check_config(config_path, type="postgresql") assert cfg == config