summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-04-24 12:59:46 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-04-24 12:59:46 +0100
commitf31f2cfbdf1c6c2f1895110c4fb22835a0ea276b (patch)
treeda63777b16d4576e60617f6da90cfd06539ce193
parent66bd59a1f14d30b8d1a5aae6cc0077fd14889268 (diff)
downloadrabbitmq-server-f31f2cfbdf1c6c2f1895110c4fb22835a0ea276b.tar.gz
Cosmetic. Ish.bug24848
-rw-r--r--src/rabbit_control.erl20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index 40663f67..8b24d2e3 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -192,16 +192,13 @@ action(force_cluster, Node, ClusterNodeSs, _Opts, Inform) ->
[Node, ClusterNodes]),
rpc_call(Node, rabbit_mnesia, force_cluster, [ClusterNodes]);
-action(wait, Node, Args, _Opts, Inform) ->
- {PidFile, Application} =
- case Args of
- [PidFile0] -> {PidFile0, rabbit};
- [PidFile0, AppString] -> {PidFile0, list_to_atom(AppString)}
- end,
+action(wait, Node, [PidFile], _Opts, Inform) ->
Inform("Waiting for ~p", [Node]),
- Pid = read_pid_file(PidFile, true),
- Inform("pid is ~s", [Pid]),
- wait_for_application(Node, Pid, Application);
+ wait_for_application(Node, PidFile, rabbit, Inform);
+
+action(wait, Node, [PidFile, App], _Opts, Inform) ->
+ Inform("Waiting for ~p on ~p", [App, Node]),
+ wait_for_application(Node, PidFile, list_to_atom(App), Inform);
action(status, Node, [], _Opts, Inform) ->
Inform("Status of node ~p", [Node]),
@@ -386,6 +383,11 @@ action(eval, Node, [Expr], _Opts, _Inform) ->
%%----------------------------------------------------------------------------
+wait_for_application(Node, PidFile, Application, Inform) ->
+ Pid = read_pid_file(PidFile, true),
+ Inform("pid is ~s", [Pid]),
+ wait_for_application(Node, Pid, Application).
+
wait_for_application(Node, Pid, Application) ->
case process_up(Pid) of
true -> case rabbit_nodes:is_running(Node, Application) of