From f072f88673dfddcbf5064b49bbe1b123957685fb Mon Sep 17 00:00:00 2001 From: Andrey Berezin Date: Wed, 22 Nov 2023 19:54:39 +0300 Subject: [PATCH] [#127] Change service registration Signed-off-by: Andrey Berezin --- pyproject.toml | 6 ++++++ src/frostfs_testlib/plugins/__init__.py | 2 +- src/frostfs_testlib/storage/__init__.py | 15 --------------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 34a37e3..7d3e5b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,12 @@ basic = "frostfs_testlib.healthcheck.basic_healthcheck:BasicHealthcheck" [project.entry-points."frostfs.testlib.csc_managers"] config = "frostfs_testlib.storage.controllers.state_managers.config_state_manager:ConfigStateManager" +[project.entry-points."frostfs.testlib.services"] +s = "frostfs_testlib.storage.dataclasses.frostfs_services:StorageNode" +s3-gate = "frostfs_testlib.storage.dataclasses.frostfs_services:S3Gate" +http-gate = "frostfs_testlib.storage.dataclasses.frostfs_services:HTTPGate" +morph-chain = "frostfs_testlib.storage.dataclasses.frostfs_services:MorphChain" +ir = "frostfs_testlib.storage.dataclasses.frostfs_services:InnerRing" [tool.isort] profile = "black" diff --git a/src/frostfs_testlib/plugins/__init__.py b/src/frostfs_testlib/plugins/__init__.py index 79de340..26b2441 100644 --- a/src/frostfs_testlib/plugins/__init__.py +++ b/src/frostfs_testlib/plugins/__init__.py @@ -23,7 +23,7 @@ def load_all(group: str) -> Any: """Loads all plugins using entry point specification. Args: - plugin_group: Name of plugin group. + group: Name of plugin group. Returns: Classes from specified group. diff --git a/src/frostfs_testlib/storage/__init__.py b/src/frostfs_testlib/storage/__init__.py index 3562d25..cbbef84 100644 --- a/src/frostfs_testlib/storage/__init__.py +++ b/src/frostfs_testlib/storage/__init__.py @@ -1,22 +1,7 @@ -from frostfs_testlib.storage.constants import _FrostfsServicesNames -from frostfs_testlib.storage.dataclasses.frostfs_services import ( - HTTPGate, - InnerRing, - MorphChain, - S3Gate, - StorageNode, -) from frostfs_testlib.storage.service_registry import ServiceRegistry __class_registry = ServiceRegistry() -# Register default public services -__class_registry.register_service(_FrostfsServicesNames.STORAGE, StorageNode) -__class_registry.register_service(_FrostfsServicesNames.INNER_RING, InnerRing) -__class_registry.register_service(_FrostfsServicesNames.MORPH_CHAIN, MorphChain) -__class_registry.register_service(_FrostfsServicesNames.S3_GATE, S3Gate) -__class_registry.register_service(_FrostfsServicesNames.HTTP_GATE, HTTPGate) - def get_service_registry() -> ServiceRegistry: """Returns registry with registered classes related to cluster and cluster nodes.