diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-03-13 10:06:41 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-03-13 10:06:41 +0000 |
| commit | e78640fb05b483c245773ec331cdf8491437a549 (patch) | |
| tree | a29717bee7bbbf33f3b8aa58d3af76f75400590b | |
| parent | 636bb978672614ad4c8546afdf742b4a50ad32c0 (diff) | |
| download | rabbitmq-server-git-e78640fb05b483c245773ec331cdf8491437a549.tar.gz | |
Try to be marginally smarter about getting the epmd port, it is set as an init argument from the environment variable.
| -rw-r--r-- | src/rabbit_nodes.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl index 3150cc017c..a753344cc5 100644 --- a/src/rabbit_nodes.erl +++ b/src/rabbit_nodes.erl @@ -78,16 +78,18 @@ diagnostics_node(Node) -> [{"~s:", [Node]} | case names(Host) of {error, Reason} -> - EpmdPort = case os:getenv("ERL_EPMD_PORT") of - false -> "4369"; - P -> P - end, [{" * unable to connect to epmd (port ~s) on ~s: ~s~n", - [EpmdPort, Host, rabbit_misc:format_inet_error(Reason)]}]; + [epmd_port(), Host, rabbit_misc:format_inet_error(Reason)]}]; {ok, NamePorts} -> diagnostics_node0(Name, Host, NamePorts) end]. +epmd_port() -> + case init:get_argument(epmd_port) of + {ok, [[Port | _] | _]} when is_list(Port) -> Port; + error -> "4369" + end. + diagnostics_node0(Name, Host, NamePorts) -> case [{N, P} || {N, P} <- NamePorts, N =:= Name] of [] -> |
