summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-03-13 10:06:41 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-03-13 10:06:41 +0000
commit18dbc1e4f8ec1e4add72e5ff24c557846aeefbeb (patch)
treea29717bee7bbbf33f3b8aa58d3af76f75400590b
parent7817189b0ac5b5c3a7a0efda4b6cd858bcbe78cc (diff)
downloadrabbitmq-server-18dbc1e4f8ec1e4add72e5ff24c557846aeefbeb.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.erl12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl
index 3150cc01..a753344c 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
[] ->