@@ -192,16 +192,13 @@ action(force_cluster, Node, ClusterNodeSs, _Opts, Inform) ->
192192 [Node , ClusterNodes ]),
193193 rpc_call (Node , rabbit_mnesia , force_cluster , [ClusterNodes ]);
194194
195- action (wait , Node , Args , _Opts , Inform ) ->
196- {PidFile , Application } =
197- case Args of
198- [PidFile0 ] -> {PidFile0 , rabbit };
199- [PidFile0 , AppString ] -> {PidFile0 , list_to_atom (AppString )}
200- end ,
195+ action (wait , Node , [PidFile ], _Opts , Inform ) ->
201196 Inform (" Waiting for ~p " , [Node ]),
202- Pid = read_pid_file (PidFile , true ),
203- Inform (" pid is ~s " , [Pid ]),
204- wait_for_application (Node , Pid , Application );
197+ wait_for_application (Node , PidFile , rabbit , Inform );
198+
199+ action (wait , Node , [PidFile , App ], _Opts , Inform ) ->
200+ Inform (" Waiting for ~p on ~p " , [App , Node ]),
201+ wait_for_application (Node , PidFile , list_to_atom (App ), Inform );
205202
206203action (status , Node , [], _Opts , Inform ) ->
207204 Inform (" Status of node ~p " , [Node ]),
@@ -386,6 +383,11 @@ action(eval, Node, [Expr], _Opts, _Inform) ->
386383
387384% %----------------------------------------------------------------------------
388385
386+ wait_for_application (Node , PidFile , Application , Inform ) ->
387+ Pid = read_pid_file (PidFile , true ),
388+ Inform (" pid is ~s " , [Pid ]),
389+ wait_for_application (Node , Pid , Application ).
390+
389391wait_for_application (Node , Pid , Application ) ->
390392 case process_up (Pid ) of
391393 true -> case rabbit_nodes :is_running (Node , Application ) of
0 commit comments