Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tanana/add option for prepending nodetool #757

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions medusa-example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
; - `<cql_k8s_secrets_path>/username` containing username
; - `<cql_k8s_secrets_path>/password` containing password
;cql_k8s_secrets_path = <path to kubernetes secrets folder>
;prefix_nodetool_command = <command to be run with && before nodetool>
;nodetool_username = <my nodetool username>
;nodetool_password = <my nodetool password>
;nodetool_password_file_path = <path to nodetool password file>
Expand Down
6 changes: 3 additions & 3 deletions medusa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

CassandraConfig = collections.namedtuple(
'CassandraConfig',
['start_cmd', 'stop_cmd', 'config_file', 'cql_username', 'cql_password', 'check_running', 'is_ccm',
'sstableloader_bin', 'nodetool_username', 'nodetool_password', 'nodetool_password_file_path', 'nodetool_host',
'nodetool_executable', 'nodetool_port', 'certfile', 'usercert', 'userkey', 'sstableloader_ts',
['prefix_nodetool_command', 'start_cmd', 'stop_cmd', 'config_file', 'cql_username', 'cql_password', 'check_running',
'is_ccm', 'sstableloader_bin', 'nodetool_username', 'nodetool_password', 'nodetool_password_file_path',
'nodetool_host', 'nodetool_executable', 'nodetool_port', 'certfile', 'usercert', 'userkey', 'sstableloader_ts',
'sstableloader_tspw', 'sstableloader_ks', 'sstableloader_kspw', 'nodetool_ssl', 'resolve_ip_addresses', 'use_sudo',
'nodetool_flags', 'cql_k8s_secrets_path', 'nodetool_k8s_secrets_path']
)
Expand Down
6 changes: 6 additions & 0 deletions medusa/nodetool.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def __init__(self, cassandra_config):
nodetool_executable = cassandra_config.nodetool_executable
nodetool_flags = cassandra_config.nodetool_flags.split(" ") if cassandra_config.nodetool_flags else []
self._nodetool = [nodetool_executable] + nodetool_flags
if cassandra_config.prefix_nodetool_command is not None:
curr_nodetool = self._nodetool
cmd_string = cassandra_config.prefix_nodetool_command + " &&"
cmd_array = cmd_string.split(" ")
cmd_array += curr_nodetool
self._nodetool = cmd_array
if cassandra_config.nodetool_ssl == "true":
self._nodetool += ['--ssl']
if cassandra_config.nodetool_username is not None:
Expand Down
Loading