From d2e85b1dbcbb140faa494cf073711a11b7db8281 Mon Sep 17 00:00:00 2001 From: 1zuna Date: Fri, 16 May 2025 18:54:18 +0700 Subject: [PATCH] fix: inaccurate number processing lenght of ip address fix: riak admin cluster join riak@10.127.20.15 inaccurate number processing: Node riak@10.1..15 is not reachable! error --- src/riak_kv_console.erl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/riak_kv_console.erl b/src/riak_kv_console.erl index 540236491..989f3b2ea 100644 --- a/src/riak_kv_console.erl +++ b/src/riak_kv_console.erl @@ -55,29 +55,30 @@ aae_tree_status/1]). join([NodeStr]) -> - join(NodeStr, fun riak_core:join/1, - "Sent join request to ~s~n", [NodeStr]). + Node = list_to_atom(NodeStr), + join(Node, fun riak_core:join/1, + "Sent join request to ~p~n", [Node]). staged_join([NodeStr]) -> Node = list_to_atom(NodeStr), - join(NodeStr, fun riak_core:staged_join/1, + join(Node, fun riak_core:staged_join/1, "Success: staged join request for ~p to ~p~n", [node(), Node]). -join(NodeStr, JoinFn, SuccessFmt, SuccessArgs) -> +join(Node, JoinFn, SuccessFmt, SuccessArgs) -> try - case JoinFn(NodeStr) of + case JoinFn(Node) of ok -> io:format(SuccessFmt, SuccessArgs), ok; {error, not_reachable} -> - io:format("Node ~s is not reachable!~n", [NodeStr]), + io:format("Node ~p is not reachable!~n", [Node]), error; {error, different_ring_sizes} -> - io:format("Failed: ~s has a different ring_creation_size~n", - [NodeStr]), + io:format("Failed: ~p has a different ring_creation_size~n", + [Node]), error; {error, unable_to_get_join_ring} -> - io:format("Failed: Unable to get ring from ~s~n", [NodeStr]), + io:format("Failed: Unable to get ring from ~p~n", [Node]), error; {error, not_single_node} -> io:format("Failed: This node is already a member of a " @@ -153,7 +154,7 @@ down([Node]) -> io:format("Success: ~p marked as down~n", [Node]), ok; {error, is_up} -> - io:format("Failed: ~s is up~n", [Node]), + io:format("Failed: ~p is up~n", [Node]), error; {error, not_member} -> io:format("Failed: ~p is not a member of the cluster.~n",