@@ -2375,9 +2375,55 @@ disable_plugin(Config, Node, Plugin) ->
23752375 plugin_action (Config , Node , [disable , Plugin ]).
23762376
23772377plugin_action (Config , Node , Args ) ->
2378- Rabbitmqplugins = ? config (rabbitmq_plugins_cmd , Config ),
23792378 NodeConfig = get_node_config (Config , Node ),
23802379 Nodename = ? config (nodename , NodeConfig ),
2380+ % % We want to use the CLI from the given node if there is a secondary
2381+ % % umbrella being configured.
2382+ I = get_node_index (Config , Node ),
2383+ CanUseSecondary = (I + 1 ) rem 2 =:= 0 ,
2384+ WithPlugins0 = rabbit_ct_helpers :get_config (Config ,
2385+ broker_with_plugins ),
2386+ WithPlugins = case is_list (WithPlugins0 ) of
2387+ true -> lists :nth (I + 1 , WithPlugins0 );
2388+ false -> WithPlugins0
2389+ end ,
2390+ UseSecondaryDist = case ? config (secondary_dist , Config ) of
2391+ false -> false ;
2392+ _ -> CanUseSecondary
2393+ end ,
2394+ UseSecondaryUmbrella = case ? config (secondary_umbrella , Config ) of
2395+ false ->
2396+ false ;
2397+ _ ->
2398+ CanUseSecondary
2399+ end ,
2400+ Rabbitmqplugins = case UseSecondaryUmbrella of
2401+ true ->
2402+ SrcDir = case WithPlugins of
2403+ false ->
2404+ ? config (
2405+ secondary_rabbit_srcdir ,
2406+ Config );
2407+ _ ->
2408+ ? config (
2409+ secondary_current_srcdir ,
2410+ Config )
2411+ end ,
2412+ SecScriptsDir = filename :join (
2413+ [SrcDir , " sbin" ]),
2414+ rabbit_misc :format (
2415+ " ~ts /rabbitmq-plugins" , [SecScriptsDir ]);
2416+ false ->
2417+ case UseSecondaryDist of
2418+ true ->
2419+ SecondaryDist = ? config (secondary_dist , Config ),
2420+ rabbit_misc :format (
2421+ " ~ts /sbin/rabbitmq-plugins" , [SecondaryDist ]);
2422+ false ->
2423+ ? config (rabbitmq_plugins_cmd , Config )
2424+ end
2425+ end ,
2426+
23812427 Env = [
23822428 {" RABBITMQ_SCRIPTS_DIR" , filename :dirname (Rabbitmqplugins )},
23832429 {" RABBITMQ_PID_FILE" , ? config (pid_file , NodeConfig )},
0 commit comments