From 938a1fa825150c37f25e43ef6fde0f06dd5ca2b6 Mon Sep 17 00:00:00 2001 From: Martin Cox Date: Tue, 12 Apr 2022 14:18:23 +0100 Subject: [PATCH] Add function for handling calls from nodetool via rpc Nodetool now expects rpc_ok as the return from any rpc call, anything other than rpc_ok is echoed out to the shell. --- src/riak_kv_console.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/riak_kv_console.erl b/src/riak_kv_console.erl index e6cb38eea..bb2b22fcc 100644 --- a/src/riak_kv_console.erl +++ b/src/riak_kv_console.erl @@ -48,6 +48,8 @@ -export([ensemble_status/1]). +-export([run_command/3]). + %% Reused by Yokozuna for printing AAE status. -export([aae_exchange_status/1, aae_repair_status/1, @@ -55,6 +57,14 @@ -include_lib("kernel/include/logger.hrl"). +run_command(Mod, Fun, Args) -> + case erlang:apply(Mod, Fun, Args) of + ok -> + rpc_ok; + Error -> + Error + end. + join([NodeStr]) -> join(NodeStr, fun riak_core:join/1, "Sent join request to ~s~n", [NodeStr]).