diff options
Diffstat (limited to 'src/rabbit_control_main.erl')
-rw-r--r-- | src/rabbit_control_main.erl | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index d85418c5..3f3a0b8b 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -445,47 +445,44 @@ action(set_parameter, Node, [Component, Key, Value], Opts, Inform) -> VHostArg = list_to_binary(proplists:get_value(?VHOST_OPT, Opts)), Inform("Setting runtime parameter ~p for component ~p to ~p", [Key, Component, Value]), - rpc_call(Node, rabbit_runtime_parameters, parse_set_param, + rpc_call(Node, rabbit_runtime_parameters, parse_set, [VHostArg, list_to_binary(Component), list_to_binary(Key), Value]); action(clear_parameter, Node, [Component, Key], Opts, Inform) -> VHostArg = list_to_binary(proplists:get_value(?VHOST_OPT, Opts)), Inform("Clearing runtime parameter ~p for component ~p", [Key, Component]), - rpc_call(Node, rabbit_runtime_parameters, clear_param, - [VHostArg, list_to_binary(Component), list_to_binary(Key)]); + rpc_call(Node, rabbit_runtime_parameters, clear, [VHostArg, + list_to_binary(Component), + list_to_binary(Key)]); action(list_parameters, Node, [], Opts, Inform) -> VHostArg = list_to_binary(proplists:get_value(?VHOST_OPT, Opts)), Inform("Listing runtime parameters", []), display_info_list( - rpc_call(Node, rabbit_runtime_parameters, list_formatted_param, - [VHostArg]), + rpc_call(Node, rabbit_runtime_parameters, list_formatted, [VHostArg]), rabbit_runtime_parameters:info_keys()); -action(set_policy, Node, [Key, Pattern, Defn | Priority], Opts, Inform) - when Priority == [] orelse length(Priority) == 1 -> +action(set_policy, Node, [Key, Pattern, Defn | Prio], Opts, Inform) + when Prio == [] orelse length(Prio) == 1 -> Msg = "Setting policy ~p for pattern ~p to ~p", - InformMsg = case Priority of [] -> Msg; - [_] -> Msg ++ " with priority ~p" - end, + {InformMsg, Prio1} = case Prio of [] -> {Msg, undefined}; + [P] -> {Msg ++ " with priority ~s", P} + end, VHostArg = list_to_binary(proplists:get_value(?VHOST_OPT, Opts)), - Inform(InformMsg, [Key, Pattern, Defn] ++ Priority), - rpc_call(Node, rabbit_runtime_parameters, parse_set_policy, - [VHostArg, list_to_binary(Key), Pattern, Defn] ++ Priority); + Inform(InformMsg, [Key, Pattern, Defn] ++ Prio), + rpc_call(Node, rabbit_policy, parse_add, + [VHostArg, list_to_binary(Key), Pattern, Defn, Prio1]); action(clear_policy, Node, [Key], Opts, Inform) -> VHostArg = list_to_binary(proplists:get_value(?VHOST_OPT, Opts)), Inform("Clearing policy ~p", [Key]), - rpc_call(Node, rabbit_runtime_parameters, clear_policy, - [VHostArg, list_to_binary(Key)]); + rpc_call(Node, rabbit_policy, delete, [VHostArg, list_to_binary(Key)]); action(list_policies, Node, [], Opts, Inform) -> VHostArg = list_to_binary(proplists:get_value(?VHOST_OPT, Opts)), Inform("Listing policies", []), - display_info_list( - rpc_call(Node, rabbit_runtime_parameters, list_formatted_policies, - [VHostArg]), - rabbit_runtime_parameters:info_keys_policy()); + display_info_list(rpc_call(Node, rabbit_policy, list_formatted, [VHostArg]), + rabbit_policy:info_keys()); action(report, Node, _Args, _Opts, Inform) -> Inform("Reporting server status on ~p~n~n", [erlang:universaltime()]), |