Refactoring old functions for FrostfsCli #145

Closed
mkadilov wants to merge 3 commits from (deleted):bug/cli_methods_moving into master
Showing only changes of commit 8ae8e0a447 - Show all commits

View file

@ -130,6 +130,10 @@ def node_shard_list(node: StorageNode, json: Optional[bool] = None) -> list[str]
wallet_config_path = f"/tmp/{node.name}-config.yaml"
wallet_password = host.get_service_config(node.name).attributes["wallet_password"]
wallet_config = f'password: "{wallet_password}"'
service_config = host.get_service_config(node.name)
wallet_path = service_config.attributes["wallet_path"]
wallet_password = service_config.attributes["wallet_password"]
wallet_config = f'wallet: {wallet_path}\npassword: "{wallet_password}"'
shell.exec(f"echo '{wallet_config}' > {wallet_config_path}")
cli = FrostfsCli(shell, cli_config.exec_path, wallet_config_path)
@ -149,8 +153,10 @@ def node_shard_set_mode(node: StorageNode, shard: list[str], mode: str) -> str:
shell = host.get_shell()
cli_config = host.get_cli_config("frostfs-cli")
wallet_config_path = f"/tmp/{node.name}-config.yaml"
wallet_password = host.get_service_config(node.name).attributes["wallet_password"]
wallet_config = f'password: "{wallet_password}"'
service_config = host.get_service_config(node.name)
wallet_path = service_config.attributes["wallet_path"]
wallet_password = service_config.attributes["wallet_password"]
wallet_config = f'wallet: {wallet_path}\npassword: "{wallet_password}"'
shell.exec(f"echo '{wallet_config}' > {wallet_config_path}")
cli = FrostfsCli(shell, cli_config.exec_path, wallet_config_path)