[#183] Read all configuration files for service config
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
751381cd60
commit
55cebc042c
5 changed files with 68 additions and 52 deletions
|
@ -9,7 +9,6 @@ from frostfs_testlib.hosting import Host, Hosting
|
|||
from frostfs_testlib.hosting.config import ServiceConfig
|
||||
from frostfs_testlib.storage import get_service_registry
|
||||
from frostfs_testlib.storage.configuration.interfaces import ServiceConfigurationYml
|
||||
from frostfs_testlib.storage.configuration.service_configuration import ServiceConfiguration
|
||||
from frostfs_testlib.storage.constants import ConfigAttributes
|
||||
from frostfs_testlib.storage.dataclasses.frostfs_services import HTTPGate, InnerRing, MorphChain, S3Gate, StorageNode
|
||||
from frostfs_testlib.storage.dataclasses.node_base import NodeBase, ServiceClass
|
||||
|
@ -72,6 +71,7 @@ class ClusterNode:
|
|||
def s3_gate(self) -> S3Gate:
|
||||
return self.service(S3Gate)
|
||||
|
||||
# TODO: Deprecated. Use config with ServiceConfigurationYml interface
|
||||
def get_config(self, config_file_path: str) -> dict:
|
||||
shell = self.host.get_shell()
|
||||
|
||||
|
@ -81,6 +81,7 @@ class ClusterNode:
|
|||
config = yaml.safe_load(config_text)
|
||||
return config
|
||||
|
||||
# TODO: Deprecated. Use config with ServiceConfigurationYml interface
|
||||
def save_config(self, new_config: dict, config_file_path: str) -> None:
|
||||
shell = self.host.get_shell()
|
||||
|
||||
|
@ -88,7 +89,7 @@ class ClusterNode:
|
|||
shell.exec(f"echo '{config_str}' | sudo tee {config_file_path}")
|
||||
|
||||
def config(self, service_type: type[ServiceClass]) -> ServiceConfigurationYml:
|
||||
return ServiceConfiguration(self.service(service_type))
|
||||
return self.service(service_type).config
|
||||
|
||||
def service(self, service_type: type[ServiceClass]) -> ServiceClass:
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue