1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

feat(cmapi): MCOL-5019: distributing cskeys secrets file, move cskeys and cspasswd functions to mcs cli.

[add] distribute .secrets file to all nodes while adding a new node
[add] encrypt_password, generate_secrets_data, save_secrets to CEJPasswordHandler
[add] tools section to mcs cli tool
[add] mcs_cluster_tool/tools_commands.py file with cskeys and cspasswd commands
[add] cskeys and cspasswd commands to tools section of mcs cli
[mv] backup/restore commands to tools section mcs cli
[fix] minor imports ordering
[fix] constants
This commit is contained in:
mariadb-AlanMologorsky
2025-03-11 15:44:25 +03:00
committed by Alan Mologorsky
parent 10dec6ea94
commit 215e4eea4d
10 changed files with 235 additions and 19 deletions

View File

@ -290,9 +290,10 @@ def broadcast_new_config(
sm_config_filename: str = DEFAULT_SM_CONF_PATH,
test_mode: bool = False,
nodes: Optional[list] = None,
timeout: Optional[int] = None
timeout: Optional[int] = None,
distribute_secrets: bool = False
) -> None:
"""Send new config to nodes in async way.
"""Send new config to nodes. Now in async way.
:param cs_config_filename: Columnstore.xml path,
defaults to DEFAULT_MCS_CONF_PATH
@ -310,6 +311,8 @@ def broadcast_new_config(
:param timeout: timeout passing to gracefully stop DMLProc TODO: for next
releases. Could affect all logic of broadcacting new config
:type timeout: Optional[int], optional
:param distribute_secrets: flag to distribute secrets to nodes
:type distribute_secrets: bool
:raises CMAPIBasicError: If Broadcasting config to nodes failed with errors
"""
@ -338,6 +341,12 @@ def broadcast_new_config(
'sm_config_filename': sm_config_filename,
'sm_config': sm_config_text
}
if distribute_secrets:
# TODO: do not restart cluster when put xml config only with
secrets = CEJPasswordHandler.get_secrets_json()
body['secrets'] = secrets
# TODO: remove test mode here and replace it by mock in tests
if test_mode:
body['test'] = True