diff options
| -rw-r--r-- | src/rabbit_cli.erl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rabbit_cli.erl b/src/rabbit_cli.erl index 33098ce16b..6147f7a120 100644 --- a/src/rabbit_cli.erl +++ b/src/rabbit_cli.erl @@ -18,7 +18,7 @@ -include("rabbit_cli.hrl"). -export([main/3, start_distribution/0, start_distribution/1, - parse_arguments/4, rpc_call/4, rpc_call/5]). + parse_arguments/4, rpc_call/4, rpc_call/5, rpc_call/7]). %%---------------------------------------------------------------------------- @@ -39,6 +39,8 @@ ([{atom(), [{string(), optdef()}]} | atom()], [{string(), optdef()}], string(), [string()]) -> parse_result()). -spec(rpc_call/4 :: (node(), atom(), atom(), [any()]) -> any()). +-spec(rpc_call/5 :: (node(), atom(), atom(), [any()]) -> any()). +-spec(rpc_call/7 :: (node(), atom(), atom(), [any()]) -> any()). -endif. @@ -106,6 +108,9 @@ main(ParseFun, DoFun, UsageMod) -> print_error("unable to connect to nodes ~p: ~w", [Nodes, Reason]), print_badrpc_diagnostics(Nodes), rabbit_misc:quit(2); + function_clause -> + print_error("invalid parameter: ~p", [Args]), + usage(UsageMod); Other -> print_error("~p", [Other]), rabbit_misc:quit(2) @@ -223,3 +228,11 @@ rpc_call(Node, Mod, Fun, Args, Timeout) -> Time -> net_kernel:set_net_ticktime(Time, 0), rpc:call(Node, Mod, Fun, Args, Timeout) end. + +rpc_call(Node, Mod, Fun, Args, Ref, Pid, Timeout) -> + case rpc:call(Node, net_kernel, get_net_ticktime, [], Timeout) of + {badrpc, _} = E -> E; + Time -> net_kernel:set_net_ticktime(Time, 0), + rpc:call(Node, Mod, Fun, Args++[Ref, Pid], Timeout) + end. + |
