RMQ-1263: An attempt to make shovel status tuple handling backwards compatible
This commit is contained in:
parent
11546aafa5
commit
4eda17bee2
|
@ -76,8 +76,14 @@ run([Name], #{node := Node, vhost := VHost}) ->
|
|||
undefined ->
|
||||
try_force_removing(Node, VHost, Name, ActingUser),
|
||||
{error, rabbit_data_coercion:to_binary(ErrMsg)};
|
||||
Match ->
|
||||
{{_Name, _VHost}, _Type, {_State, Opts}, _Metrics, _Timestamp} = Match,
|
||||
{{_Name, _VHost}, _Type, {_State, Opts}, _Metrics, _Timestamp} ->
|
||||
delete_shovel(ErrMsg, VHost, Name, ActingUser, Opts, Node);
|
||||
{{_Name, _VHost}, _Type, {_State, Opts}, _Timestamp} ->
|
||||
delete_shovel(ErrMsg, VHost, Name, ActingUser, Opts, Node)
|
||||
end
|
||||
end.
|
||||
|
||||
delete_shovel(ErrMsg, VHost, Name, ActingUser, Opts, Node) ->
|
||||
{_, HostingNode} = lists:keyfind(node, 1, Opts),
|
||||
case rabbit_misc:rpc_call(
|
||||
HostingNode, rabbit_shovel_util, delete_shovel, [VHost, Name, ActingUser]) of
|
||||
|
@ -89,8 +95,6 @@ run([Name], #{node := Node, vhost := VHost}) ->
|
|||
ok ->
|
||||
_ = try_clearing_runtime_parameter(Node, VHost, Name, ActingUser),
|
||||
ok
|
||||
end
|
||||
end
|
||||
end.
|
||||
|
||||
switches() ->
|
||||
|
|
|
@ -62,8 +62,14 @@ run([Name], #{node := Node, vhost := VHost}) ->
|
|||
case rabbit_shovel_status:find_matching_shovel(VHost, Name, Xs) of
|
||||
undefined ->
|
||||
{error, rabbit_data_coercion:to_binary(ErrMsg)};
|
||||
Match ->
|
||||
{{_Name, _VHost}, _Type, {_State, Opts}, _Metrics, _Timestamp} = Match,
|
||||
{{_Name, _VHost}, _Type, {_State, Opts}, _Metrics, _Timestamp} ->
|
||||
restart_shovel(ErrMsg, Name, VHost, Opts);
|
||||
{{_Name, _VHost}, _Type, {_State, Opts}, _Timestamp} ->
|
||||
restart_shovel(ErrMsg, Name, VHost, Opts)
|
||||
end
|
||||
end.
|
||||
|
||||
restart_shovel(ErrMsg, Name, VHost, Opts) ->
|
||||
{_, HostingNode} = lists:keyfind(node, 1, Opts),
|
||||
case rabbit_misc:rpc_call(
|
||||
HostingNode, rabbit_shovel_util, restart_shovel, [VHost, Name]) of
|
||||
|
@ -72,8 +78,6 @@ run([Name], #{node := Node, vhost := VHost}) ->
|
|||
{error, not_found} ->
|
||||
{error, rabbit_data_coercion:to_binary(ErrMsg)};
|
||||
ok -> ok
|
||||
end
|
||||
end
|
||||
end.
|
||||
|
||||
output(Output, _Opts) ->
|
||||
|
|
|
@ -43,6 +43,10 @@ status(Node) ->
|
|||
end.
|
||||
|
||||
format(Node, {Name, Type, Info, _Metrics, TS}) ->
|
||||
[{node, Node}, {timestamp, format_ts(TS)}] ++
|
||||
format_name(Type, Name) ++
|
||||
format_info(Info);
|
||||
format(Node, {Name, Type, Info, TS}) ->
|
||||
[{node, Node}, {timestamp, format_ts(TS)}] ++
|
||||
format_name(Type, Name) ++
|
||||
format_info(Info).
|
||||
|
|
Loading…
Reference in New Issue