@@ -68,7 +68,6 @@ run([Name], #{node := Node, vhost := VHost, force := Force}) ->
6868 true -> ? INTERNAL_USER ;
6969 false -> 'Elixir.RabbitMQ.CLI.Core.Helpers' :cli_acting_user ()
7070 end ,
71-
7271 case rabbit_misc :rpc_call (Node , rabbit_shovel_status , cluster_status_with_nodes , []) of
7372 {badrpc , _ } = Error ->
7473 Error ;
@@ -82,14 +81,15 @@ run([Name], #{node := Node, vhost := VHost, force := Force}) ->
8281 try_force_removing (Node , VHost , Name , ActingUser ),
8382 {error , rabbit_data_coercion :to_binary (ErrMsg )};
8483 {{_Name , _VHost }, _Type , {_State , Opts }, _Metrics , _Timestamp } ->
85- delete_shovel (ErrMsg , VHost , Name , ActingUser , Opts , Node );
84+ HostingNode = proplists :get_value (node , Opts , Node ),
85+ delete_shovel (ErrMsg , VHost , Name , ActingUser , HostingNode , Node );
8686 {{_Name , _VHost }, _Type , {_State , Opts }, _Timestamp } ->
87- delete_shovel (ErrMsg , VHost , Name , ActingUser , Opts , Node )
87+ HostingNode = proplists :get_value (node , Opts , Node ),
88+ delete_shovel (ErrMsg , VHost , Name , ActingUser , HostingNode , Node )
8889 end
8990 end .
9091
91- delete_shovel (ErrMsg , VHost , Name , ActingUser , Opts , Node ) ->
92- {_ , HostingNode } = lists :keyfind (node , 1 , Opts ),
92+ delete_shovel (ErrMsg , VHost , Name , ActingUser , HostingNode , Node ) ->
9393 case rabbit_misc :rpc_call (
9494 HostingNode , rabbit_shovel_util , delete_shovel , [VHost , Name , ActingUser ]) of
9595 {badrpc , _ } = Error ->
0 commit comments