Skip to content

Commit 9dc1ad0

Browse files
author
Simon MacMullen
committed
Revert most of the merge of bug24315 apart from rabbit_misc:with_local_io/1 since that's now used elsewhere.
1 parent f0731e9 commit 9dc1ad0

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

src/rabbit_control.erl

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
-module(rabbit_control).
1818
-include("rabbit.hrl").
1919

20-
-export([start/0, stop/0, action/5, diagnostics/1, log_action/3]).
20+
-export([start/0, stop/0, action/5, diagnostics/1]).
2121

2222
-define(RPC_TIMEOUT, infinity).
2323

@@ -50,7 +50,6 @@
5050
-> 'ok').
5151
-spec(diagnostics/1 :: (node()) -> [{string(), [any()]}]).
5252
-spec(usage/0 :: () -> no_return()).
53-
-spec(log_action/3 :: (node(), string(), [term()]) -> ok).
5453

5554
-endif.
5655

@@ -73,7 +72,6 @@ start() ->
7372
Command = list_to_atom(Command0),
7473
Quiet = proplists:get_bool(?QUIET_OPT, Opts1),
7574
Node = proplists:get_value(?NODE_OPT, Opts1),
76-
rpc_call(Node, rabbit_control, log_action, [node(), Command0, Args]),
7775
Inform = case Quiet of
7876
true -> fun (_Format, _Args1) -> ok end;
7977
false -> fun (Format, Args1) ->
@@ -521,22 +519,3 @@ quit(Status) ->
521519
{unix, _} -> halt(Status);
522520
{win32, _} -> init:stop(Status)
523521
end.
524-
525-
log_action(Node, Command, Args) ->
526-
rabbit_misc:with_local_io(
527-
fun () ->
528-
error_logger:info_msg("~p executing~n rabbitmqctl ~s ~s~n",
529-
[Node, Command,
530-
format_args(mask_args(Command, Args))])
531-
end).
532-
533-
%% Mask passwords and other sensitive info before logging.
534-
mask_args("add_user", [Name, _Password | Args]) ->
535-
[Name, "****" | Args];
536-
mask_args("change_password", [Name, _Password | Args]) ->
537-
[Name, "****" | Args];
538-
mask_args(_, Args) ->
539-
Args.
540-
541-
format_args(Args) ->
542-
string:join([io_lib:format("~p", [A]) || A <- Args], " ").

0 commit comments

Comments
 (0)