Skip to content
Merged
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
27 changes: 24 additions & 3 deletions priv/base/nodetool
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ main(Args) ->
io:format("~p\n", [rpc:call(TargetNode, init, restart, [], RpcTimeout)]);
["reboot"] ->
io:format("~p\n", [rpc:call(TargetNode, init, reboot, [], RpcTimeout)]);
["rpc", Module, Function] ->
case rpc:call(TargetNode, list_to_atom(Module), list_to_atom(Function),
[], RpcTimeout) of
ok ->
ok;
{badrpc, Reason} ->
io:format(standard_error, "RPC to ~p failed: ~p\n", [TargetNode, Reason]),
halt(1);
_ ->
halt(1)
end;
["rpc", Module, Function | RpcArgs] ->
case rpc:call(TargetNode, list_to_atom(Module), list_to_atom(Function),
[RpcArgs], RpcTimeout) of
Expand All @@ -74,6 +85,16 @@ main(Args) ->
_ ->
halt(1)
end;
["rpc_infinity", Module, Function] ->
case rpc:call(TargetNode, list_to_atom(Module), list_to_atom(Function), [], infinity) of
ok ->
ok;
{badrpc, Reason} ->
io:format(standard_error, "RPC to ~p failed: ~p\n", [TargetNode, Reason]),
halt(1);
_ ->
halt(1)
end;
["rpc_infinity", Module, Function | RpcArgs] ->
case rpc:call(TargetNode, list_to_atom(Module), list_to_atom(Function), [RpcArgs], infinity) of
ok ->
Expand Down Expand Up @@ -167,13 +188,13 @@ chkconfig(File) ->
io:format("ok\n"),
halt(0);
{error, {Line, Mod, Term}} ->
io:format(standard_error,
["Error on line ",
io:format(standard_error,
["Error on line ",
file:format_error({Line, Mod, Term}), "\n"], []),
halt(1);
{error, R} ->
io:format(standard_error,
["Error reading config file: ",
["Error reading config file: ",
file:format_error(R), "\n"], []),
halt(1)
end.
Expand Down