diff --git a/docs/dev-info.rst b/docs/dev-info.rst --- a/docs/dev-info.rst +++ b/docs/dev-info.rst @@ -45,18 +45,15 @@ # storage to read sha1's metadata (path) # storage: # cls: local - # args: - # db: "service=swh-dev" - # objstorage: - # cls: pathslicing - # args: - # root: /home/storage/swh-storage/ - # slicing: 0:1/1:5 + # db: "service=swh-dev" + # objstorage: + # cls: pathslicing + # root: /home/storage/swh-storage/ + # slicing: 0:1/1:5 storage: cls: remote - args: - url: http://localhost:5002/ + url: http://localhost:5002/ indexer_storage: cls: remote @@ -68,9 +65,8 @@ # locally: this needs to match your storage's setup objstorage: cls: pathslicing - args: - slicing: 0:1/1:5 - root: /home/storage/swh-storage/ + slicing: 0:1/1:5 + root: /home/storage/swh-storage/ destination_task: swh.indexer.tasks.SWHOrchestratorTextContentsTask rescheduling_task: swh.indexer.tasks.SWHContentMimetypeTask @@ -84,13 +80,11 @@ # storage to read sha1's metadata (path) # storage: # cls: local - # args: - # db: "service=swh-dev" - # objstorage: - # cls: pathslicing - # args: - # root: /home/storage/swh-storage/ - # slicing: 0:1/1:5 + # db: "service=swh-dev" + # objstorage: + # cls: pathslicing + # root: /home/storage/swh-storage/ + # slicing: 0:1/1:5 storage: cls: remote @@ -106,9 +100,8 @@ # locally: this needs to match your storage's setup objstorage: cls: pathslicing - args: - slicing: 0:1/1:5 - root: /home/storage/swh-storage/ + slicing: 0:1/1:5 + root: /home/storage/swh-storage/ workdir: /tmp/swh/worker.indexer/license/ diff --git a/requirements-swh.txt b/requirements-swh.txt --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,6 +1,6 @@ swh.core[db,http] >= 0.3 swh.model >= 0.0.15 -swh.objstorage >= 0.0.43 +swh.objstorage >= 0.2.2 swh.scheduler >= 0.5.2 swh.storage >= 0.12.0 swh.journal >= 0.1.0 diff --git a/requirements.txt b/requirements.txt --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -vcversioner click python-magic >= 0.4.13 pyld diff --git a/swh/indexer/cli.py b/swh/indexer/cli.py --- a/swh/indexer/cli.py +++ b/swh/indexer/cli.py @@ -40,7 +40,7 @@ def _get_api(getter, config, config_key, url): if url: - config[config_key] = {"cls": "remote", "args": {"url": url}} + config[config_key] = {"cls": "remote", "url": url} elif config_key not in config: raise click.ClickException("Missing configuration for {}".format(config_key)) return getter(**config[config_key]) diff --git a/swh/indexer/indexer.py b/swh/indexer/indexer.py --- a/swh/indexer/indexer.py +++ b/swh/indexer/indexer.py @@ -158,8 +158,7 @@ if config_storage: self.storage = get_storage(**config_storage) - objstorage = self.config["objstorage"] - self.objstorage = get_objstorage(objstorage["cls"], objstorage["args"]) + self.objstorage = get_objstorage(**self.config["objstorage"]) idx_storage = self.config[INDEXER_CFG_KEY] self.idx_storage = get_indexer_storage(**idx_storage) diff --git a/swh/indexer/tests/conftest.py b/swh/indexer/tests/conftest.py --- a/swh/indexer/tests/conftest.py +++ b/swh/indexer/tests/conftest.py @@ -73,7 +73,7 @@ classes. """ - objstorage = get_objstorage("memory", {}) + objstorage = get_objstorage("memory") fill_obj_storage(objstorage) with patch.dict( "swh.objstorage.factory._STORAGE_CLASSES", {"memory": lambda: objstorage} @@ -85,8 +85,8 @@ def swh_indexer_config(): return { "storage": {"cls": "memory"}, - "objstorage": {"cls": "memory", "args": {},}, - "indexer_storage": {"cls": "memory", "args": {},}, + "objstorage": {"cls": "memory"}, + "indexer_storage": {"cls": "memory"}, "tools": { "name": "file", "version": "1:5.30-1+deb9u1", diff --git a/swh/indexer/tests/utils.py b/swh/indexer/tests/utils.py --- a/swh/indexer/tests/utils.py +++ b/swh/indexer/tests/utils.py @@ -34,8 +34,8 @@ BASE_TEST_CONFIG: Dict[str, Dict[str, Any]] = { "storage": {"cls": "memory"}, - "objstorage": {"cls": "memory", "args": {},}, - INDEXER_CFG_KEY: {"cls": "memory", "args": {},}, + "objstorage": {"cls": "memory"}, + INDEXER_CFG_KEY: {"cls": "memory"}, }