From e73585cf50bdeeead3ead642047ed72a87bd6f44 Mon Sep 17 00:00:00 2001 From: anikeev-yadro Date: Mon, 13 Mar 2023 15:45:06 +0300 Subject: [PATCH] Add morph remove node command Signed-off-by: anikeev-yadro --- src/frostfs_testlib/cli/frostfs_adm/morph.py | 30 ++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/frostfs_testlib/cli/frostfs_adm/morph.py b/src/frostfs_testlib/cli/frostfs_adm/morph.py index aba147b7..3faa875d 100644 --- a/src/frostfs_testlib/cli/frostfs_adm/morph.py +++ b/src/frostfs_testlib/cli/frostfs_adm/morph.py @@ -127,12 +127,12 @@ class FrostfsAdmMorph(CliCommand): ) def force_new_epoch( - self, rpc_endpoint: Optional[str] = None, alphabet: Optional[str] = None + self, rpc_endpoint: Optional[str] = None, alphabet_wallets: Optional[str] = None ) -> CommandResult: """Create new FrostFS epoch event in the side chain. Args: - alphabet: Path to alphabet wallets dir. + alphabet_wallets: Path to alphabet wallets dir. rpc_endpoint: N3 RPC node endpoint. Returns: @@ -354,3 +354,29 @@ class FrostfsAdmMorph(CliCommand): if param not in ["self"] }, ) + + def remove_nodes( + self, node_netmap_keys: list[str], rpc_endpoint: Optional[str] = None, alphabet_wallets: Optional[str] = None + ) -> CommandResult: + """ Move node to the Offline state in the candidates list + and tick an epoch to update the netmap using frostfs-adm + + Args: + node_netmap_keys: list of nodes netmap keys. + alphabet_wallets: Path to alphabet wallets dir. + rpc_endpoint: N3 RPC node endpoint. + + Returns: + Command's result. + """ + if not len(node_netmap_keys): + raise AttributeError("Got empty node_netmap_keys list") + + return self._execute( + f"morph remove-nodes {' '.join(node_netmap_keys)}", + **{ + param: param_value + for param, param_value in locals().items() + if param not in ["self", "node_netmap_keys"] + }, + ) \ No newline at end of file