forked from TrueCloudLab/frostfs-testlib
[#102] Updates for failover
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
0c3bb20af5
commit
b1a3d740e9
5 changed files with 51 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
from abc import abstractmethod
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional, Tuple, TypedDict, TypeVar
|
||||
from typing import Optional, TypedDict, TypeVar
|
||||
|
||||
import yaml
|
||||
|
||||
|
@ -103,8 +103,10 @@ class NodeBase(HumanReadableABC):
|
|||
ConfigAttributes.WALLET_CONFIG,
|
||||
)
|
||||
|
||||
def get_config(self) -> Tuple[str, dict]:
|
||||
config_file_path = self._get_attribute(ConfigAttributes.CONFIG_PATH)
|
||||
def get_config(self, config_file_path: Optional[str] = None) -> tuple[str, dict]:
|
||||
if config_file_path is None:
|
||||
config_file_path = self._get_attribute(ConfigAttributes.CONFIG_PATH)
|
||||
|
||||
shell = self.host.get_shell()
|
||||
|
||||
result = shell.exec(f"cat {config_file_path}")
|
||||
|
@ -113,8 +115,10 @@ class NodeBase(HumanReadableABC):
|
|||
config = yaml.safe_load(config_text)
|
||||
return config_file_path, config
|
||||
|
||||
def save_config(self, new_config: dict) -> None:
|
||||
config_file_path = self._get_attribute(ConfigAttributes.CONFIG_PATH)
|
||||
def save_config(self, new_config: dict, config_file_path: Optional[str] = None) -> None:
|
||||
if config_file_path is None:
|
||||
config_file_path = self._get_attribute(ConfigAttributes.CONFIG_PATH)
|
||||
|
||||
shell = self.host.get_shell()
|
||||
|
||||
config_str = yaml.dump(new_config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue